Re: DIP69: problem with scope grammar - need a new keyword

2014-12-08 Thread deadalnix via Digitalmars-d
On Monday, 8 December 2014 at 10:37:29 UTC, Walter Bright wrote: On 12/8/2014 1:52 AM, deadalnix wrote: On Monday, 8 December 2014 at 09:46:03 UTC, Walter Bright wrote: I thought I could make this work, but it's a problem. There are two meanings for scope when attached to a function: T

Re: DIP69: problem with scope grammar - need a new keyword

2014-12-08 Thread Walter Bright via Digitalmars-d
On 12/8/2014 11:57 AM, deadalnix wrote: On Monday, 8 December 2014 at 10:37:29 UTC, Walter Bright wrote: On 12/8/2014 1:52 AM, deadalnix wrote: On Monday, 8 December 2014 at 09:46:03 UTC, Walter Bright wrote: I thought I could make this work, but it's a problem. There are two meanings for

Re: D3

2014-12-08 Thread Andrej Mitrovic via Digitalmars-d
On 12/8/14, Russel Winder via Digitalmars-d digitalmars-d@puremagic.com wrote: It seems that D3 is already available: https://github.com/mbostock/d3 Guess we'll just have to skip a number and call the next D - D4. :)

Re: DIP69: problem with scope grammar - need a new keyword

2014-12-08 Thread deadalnix via Digitalmars-d
On Monday, 8 December 2014 at 20:14:23 UTC, Walter Bright wrote: This would be inconsistent with the rest of the types, where qualifier on the left affects the symbol. But I like the idea of: T scope delegate() dg; as meaning the scope affects the return type. Is that what you meant?

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Dicebot via Digitalmars-d
On Monday, 8 December 2014 at 19:44:48 UTC, Walter Bright wrote: The difference between 'scope ref' and 'ref' parameters is that the former cannot be returned by reference. The difference between 'scope ref' and 'ref' function returns is that the former cannot be saved by the caller. You

Re: D3

2014-12-08 Thread Idan Arye via Digitalmars-d
On Monday, 8 December 2014 at 20:21:51 UTC, Andrej Mitrovic via Digitalmars-d wrote: On 12/8/14, Russel Winder via Digitalmars-d digitalmars-d@puremagic.com wrote: It seems that D3 is already available: https://github.com/mbostock/d3 Guess we'll just have to skip a number and call the next D

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Walter Bright via Digitalmars-d
On 12/8/2014 12:54 PM, Dicebot wrote: On Monday, 8 December 2014 at 19:44:48 UTC, Walter Bright wrote: I agree it's a seductively simple idea. The trouble starts happening when you start when making ref idempotent, when ref can only be at the 'head' of a data structure, when trying to do type

Re: D3

2014-12-08 Thread Brad Anderson via Digitalmars-d
On Monday, 8 December 2014 at 20:21:51 UTC, Andrej Mitrovic via Digitalmars-d wrote: On 12/8/14, Russel Winder via Digitalmars-d digitalmars-d@puremagic.com wrote: It seems that D3 is already available: https://github.com/mbostock/d3 Guess we'll just have to skip a number and call the next D

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Walter Bright via Digitalmars-d
On 12/8/2014 12:54 PM, Dicebot wrote: struct ByLine { scope string front(); // ... } auto byLine(File file) { return ByLine(file); } scope /* ref */ string foo(scope /* ref */ string input) { return input[1..$]; } void main() { auto r = file.byLine.map!foo;

Re: LogLevel [was std.experimental.logger formal review round 3]

2014-12-08 Thread Andrei Alexandrescu via Digitalmars-d
On 12/4/14 8:16 PM, Martin Nowak wrote: On Thursday, 4 December 2014 at 08:14:56 UTC, Jacob Carlborg wrote: On 2014-12-04 02:10, Martin Nowak wrote: I just found a very compelling alternative solution to the LogLevel disabling problem. This was one of the reasons for the delay of std.log and

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Walter Bright via Digitalmars-d
On 12/7/2014 2:46 AM, Sebastiaan Koppe wrote: On Friday, 5 December 2014 at 23:58:41 UTC, Walter Bright wrote: On 12/5/2014 8:48 AM, Marc Schütz schue...@gmx.net wrote: scope ref int foo(); scope ref int bar1(ref int a) { return a; } scope ref int bar2(scope ref int a)

Re: LogLevel [was std.experimental.logger formal review round 3]

2014-12-08 Thread Andrei Alexandrescu via Digitalmars-d
On 12/4/14 8:37 PM, Robert burner Schadek wrote: That is much nicer, thank you for taking the time. Couldn't way just say that we don't import __MODULE__ but rather __MODULE__ ~ _loggerinfo.d and then describe the import constraint in the documentation. Perhaps that might improve error

Re: DIP69: problem with scope grammar - need a new keyword

2014-12-08 Thread Paolo Invernizzi via Digitalmars-d
On Monday, 8 December 2014 at 20:42:49 UTC, deadalnix wrote: No I mean the reverse. Let's make it with const as it is better understood by everybody, and at the end we discuss grammar, so it doesn't matter. const A delegate() a; // A mutable delegate that return a const(A) A const

Re: Any SIMD experts?

2014-12-08 Thread Martin Nowak via Digitalmars-d
On 12/08/2014 06:21 PM, Etienne wrote: Are you using it for the binary search part (find pool) ? Nope the binary search is surprisingly fine, but I had it on my list of subjects for quite a while too.

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Tobias Müller via Digitalmars-d
Walter Bright newshou...@digitalmars.com wrote: [...] and ref's can still be null in C++! AFAIK only if you dereference a NULL pointer, which is UB. So not really. [...] Tobi

Re: Any SIMD experts?

2014-12-08 Thread Martin Nowak via Digitalmars-d
On 12/08/2014 05:55 PM, John Colvin wrote: I don't quite understand what you mean by save one conditional. Instead of if (v = low v high) it's if (cast(size_t)(v - low) size) So there is only one branch. There are other ways to eliminate one branch, for example this. if ((v = low)

Re: Any SIMD experts?

2014-12-08 Thread Martin Nowak via Digitalmars-d
On 12/08/2014 05:57 PM, ponce wrote: This doesn't work if vhigh - vlow spans a too large area. It won't unless you allocate more than 4GB of RAM.

Re: Any SIMD experts?

2014-12-08 Thread Martin Nowak via Digitalmars-d
On 12/08/2014 06:05 PM, John Colvin wrote: Well gcc gives me: Tried that with dmd, it gave me. bug.d(5): Error: incompatible types for ((a) = (l)): '__vector(ulong[4])' and '__vector(ulong[4])' bug.d(5): Error: incompatible types for ((a) (h)): '__vector(ulong[4])' and '__vector(ulong[4])'

Re: Symbol lookup rules and imports

2014-12-08 Thread Walter Bright via Digitalmars-d
On 12/8/2014 7:52 AM, H. S. Teoh via Digitalmars-d wrote: I realize that my understanding on the workings of dmd may not be quite accurate, and I apologize for any inadvertent misrepresentations, but the fact remains that the current behaviour of import is very counterintuitive, and users will

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Walter Bright via Digitalmars-d
On 12/8/2014 1:59 PM, Tobias Müller wrote: Walter Bright newshou...@digitalmars.com wrote: [...] and ref's can still be null in C++! AFAIK only if you dereference a NULL pointer, which is UB. So not really. Saying it's UB doesn't help in the slightest. You can still have null ref's, and no

Re: Any SIMD experts?

2014-12-08 Thread ponce via Digitalmars-d
On Monday, 8 December 2014 at 22:37:08 UTC, ponce wrote: vresult - mask 31 (for each dword) Correction: vresult - mask 63 (for each qword)

Re: Any SIMD experts?

2014-12-08 Thread ponce via Digitalmars-d
On Monday, 8 December 2014 at 16:32:50 UTC, Martin Nowak wrote: I want to do bounds checking of 2 (4 on avx) ulongs (64-bit) at a time. ulong2 vval = [v0, v1]; ulong2 vlow = [low, low]; ulong2 vhigh = [high, high]; int res = PMOVMSKB(vval = vlow vval vhigh); I figured out sort of a

Re: D3

2014-12-08 Thread tl12000 via Digitalmars-d
On Monday, 8 December 2014 at 20:21:51 UTC, Andrej Mitrovic via Digitalmars-d wrote: On 12/8/14, Russel Winder via Digitalmars-d digitalmars-d@puremagic.com wrote: It seems that D3 is already available: https://github.com/mbostock/d3 Guess we'll just have to skip a number and call the next D

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread deadalnix via Digitalmars-d
On Saturday, 6 December 2014 at 21:57:03 UTC, Walter Bright wrote: On 12/5/2014 3:59 PM, deadalnix wrote: The DIP say nothing about scoped rvalue having different behavior than non scoped ones. Can you propose some new wording? I did: An infinite lifetime is a lifetime greater or equal

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread deadalnix via Digitalmars-d
On Saturday, 6 December 2014 at 23:59:01 UTC, Piotrek wrote: On Saturday, 6 December 2014 at 11:06:16 UTC, Jacob Carlborg wrote: On 2014-12-06 10:50, Manu via Digitalmars-d wrote: I've been over it so many times. I suggest you take the time and write down how your vision of ref looks like

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread deadalnix via Digitalmars-d
On Sunday, 7 December 2014 at 05:24:20 UTC, Walter Bright wrote: I appreciate that. That was uncontroversial though; I didn't need to spend months or years trying to justify my claims on that issue. I feel like that was a known item that was just somewhere slightly down the list, and I was

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread deadalnix via Digitalmars-d
On Saturday, 6 December 2014 at 12:38:24 UTC, Ola Fosheim Grøstad wrote: On Saturday, 6 December 2014 at 04:31:48 UTC, Sebastiaan Koppe wrote: What about also adding the inverse of scope? Then scope can be inferred. As in: ``` void foo(int* p); void free(P)(consume P* p); Yes, this is much

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread deadalnix via Digitalmars-d
On Sunday, 7 December 2014 at 21:29:50 UTC, Walter Bright wrote: My experience with C++ ref as type qualifier is very, very bad. It's a special case EVERYWHERE. Doing type deduction with it is an exercise in a completely baffling set of rules and a different rule for every occasion - Scott

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Dicebot via Digitalmars-d
On Monday, 8 December 2014 at 21:12:47 UTC, Walter Bright wrote: On 12/8/2014 12:54 PM, Dicebot wrote: struct ByLine { scope string front(); // ... } auto byLine(File file) { return ByLine(file); } scope /* ref */ string foo(scope /* ref */ string input) { return input[1..$];

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread deadalnix via Digitalmars-d
On Monday, 8 December 2014 at 16:25:22 UTC, Dicebot wrote: This isn't the same as it does not propagate scope but just restricts return value. Difference is that it cannot be chained. Let's consider practical example based on Phobos: there was an issue with byLine range that it has reused

Re: DIP69: problem with scope grammar - need a new keyword

2014-12-08 Thread bearophile via Digitalmars-d
Walter Bright: I have some ideas, but don't particularly like any of them. But I don't want to bias things, so what ideas do you guys have? In this thread I have seen lot of discussion about the location of const for struct/class methods, and I agree this is an interesting topic, but one of

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread deadalnix via Digitalmars-d
On Monday, 8 December 2014 at 20:54:54 UTC, Dicebot wrote: But was there any reason why those traits (alien to type qualifiers) were pursued? What is the problem with `ref` simply meaning `non-null pointer` and allowing non-idempotent ref(ref(int))? Please no. when you do int a; and then

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Dicebot via Digitalmars-d
On Monday, 8 December 2014 at 23:05:49 UTC, deadalnix wrote: scope(int)[] do not make any sense. The slice cannot outlive its content. scope as a flag on expressions/symbols is very useful. I'd say it strange for directly the opposite reason - pure value type is inherently scope so adding

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Dicebot via Digitalmars-d
On Monday, 8 December 2014 at 21:07:39 UTC, Walter Bright wrote: But was there any reason why those traits (alien to type qualifiers) were pursued? What is the problem with `ref` simply meaning `non-null pointer` and allowing non-idempotent ref(ref(int))? Because it isn't just a non-null

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread deadalnix via Digitalmars-d
On Monday, 8 December 2014 at 21:16:36 UTC, Walter Bright wrote: A 'scope ref' parameter may not be returned as a 'ref' or a 'scope ref'. It can safely be returned if you consider its lifetime as the intersection of the lifetime of the function's parameter.

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread Dicebot via Digitalmars-d
On Monday, 8 December 2014 at 23:19:26 UTC, deadalnix wrote: On Monday, 8 December 2014 at 20:54:54 UTC, Dicebot wrote: But was there any reason why those traits (alien to type qualifiers) were pursued? What is the problem with `ref` simply meaning `non-null pointer` and allowing

Re: DIP69 - Implement scope for escape proof references

2014-12-08 Thread bearophile via Digitalmars-d
Walter Bright: Safety by default is outside of the sco[pe (!) of this discussion. Also, you can merely put: @safe: at the beginning of a module and it is now all safe. If that topic is outside the scope of this discussion, then I have opened an ER on it:

Re: Any SIMD experts?

2014-12-08 Thread Martin Nowak via Digitalmars-d
On 12/08/2014 06:20 PM, John Colvin wrote: To conceptually get what it's doing here, the trick is that it's offsetting the values so as to simulate unsigned comparisons using signed instructions. All too easy, but would've taken me a pen and paper to realize :).

Re: Any SIMD experts?

2014-12-08 Thread John Colvin via Digitalmars-d
On Monday, 8 December 2014 at 23:40:21 UTC, Martin Nowak wrote: On 12/08/2014 06:20 PM, John Colvin wrote: To conceptually get what it's doing here, the trick is that it's offsetting the values so as to simulate unsigned comparisons using signed instructions. All too easy, but would've

Re: std.stdint seems to be an outcast?

2014-12-08 Thread Kapps via Digitalmars-d
On Monday, 8 December 2014 at 17:21:00 UTC, Gary Willoughby wrote: There is a module called std.stdint located here: http://dlang.org/phobos/std_stdint.html but it doesn't appear in the documentation index here: http://dlang.org/phobos/index.html Not only that but when looking at the source

Proposal for a New Newsgroup

2014-12-08 Thread Mike Parker via Digitalmars-d
I've noticed an increase in the number of people coming to these forums (particularly .learn) for help with some of the tools and libraries in the D ecosystem. Some of these projects have their own forums, others don't. I think it would be beneficial to have a new group on the news server,

Re: Proposal for a New Newsgroup

2014-12-08 Thread Rikki Cattermole via Digitalmars-d
On 9/12/2014 2:46 p.m., Mike Parker wrote: I've noticed an increase in the number of people coming to these forums (particularly .learn) for help with some of the tools and libraries in the D ecosystem. Some of these projects have their own forums, others don't. I think it would be beneficial to

Re: problem with size_t and an easy solution

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 15:52:07 + bitwise via Digitalmars-d digitalmars-d@puremagic.com wrote: FWIW, I picked hp D ~2 months ago, and my first project was a reflection library, so I've had a chance to deal with most of the language features at least once so far. The naming and presence of

Re: problem with size_t and an easy solution

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 15:05:18 + Jonathan Marler via Digitalmars-d digitalmars-d@puremagic.com wrote: What about 'usize' and 'ptrdiff' ? `sptrdiff`, as i did it in my branch. `ssize` was just an example, i don't like it too. yet `sptrdiff` is still ugly. why 'ptr', what it has to do with

Re: problem with size_t and an easy solution

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 15:39:53 + Ivan Kazmenko via Digitalmars-d digitalmars-d@puremagic.com wrote: On Monday, 8 December 2014 at 14:31:50 UTC, ketmar via Digitalmars-d wrote: On Mon, 08 Dec 2014 13:49:30 + Ivan Kazmenko via Digitalmars-d digitalmars-d@puremagic.com wrote:

Re: problem with size_t and an easy solution

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 16:03:42 + Kagamin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Monday, 8 December 2014 at 08:46:49 UTC, bearophile wrote: Freddy: Why not keep size_t implictly convertable but disallow it for usize. This is an interesting idea. (But the name uword

Re: Symbol lookup rules and imports

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 14:30:08 -0800 Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: The two-step lookup method, of current scope then imports in current scope, is misunderstood by nearly everyone. this is the clear sign of the existing problem. signature.asc Description:

Re: DIP69: problem with scope grammar - need a new keyword

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 20:42:48 + deadalnix via Digitalmars-d digitalmars-d@puremagic.com wrote: If consistency is a measure, the proposal is a winner. ah, it seems to me that consistency never had high priority. signature.asc Description: PGP signature

Re: DIP69: problem with scope grammar - need a new keyword

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 23:15:25 + bearophile via Digitalmars-d digitalmars-d@puremagic.com wrote: Walter Bright: I have some ideas, but don't particularly like any of them. But I don't want to bias things, so what ideas do you guys have? In this thread I have seen lot of discussion

Re: Symbol lookup rules and imports

2014-12-08 Thread Walter Bright via Digitalmars-d
On 12/8/2014 7:34 PM, ketmar via Digitalmars-d wrote: On Mon, 08 Dec 2014 14:30:08 -0800 Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: The two-step lookup method, of current scope then imports in current scope, is misunderstood by nearly everyone. this is the clear sign

Re: problem with size_t and an easy solution

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 17:33:48 + Gary Willoughby via Digitalmars-d digitalmars-d@puremagic.com wrote: On Monday, 8 December 2014 at 01:30:35 UTC, ketmar via Digitalmars-d wrote: Hello. i don't like `size_t`. for many month i avoied using it wherever that was possible, 'cause i

Re: D3

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 21:08:03 + Brad Anderson via Digitalmars-d digitalmars-d@puremagic.com wrote: On Monday, 8 December 2014 at 20:21:51 UTC, Andrej Mitrovic via Digitalmars-d wrote: On 12/8/14, Russel Winder via Digitalmars-d digitalmars-d@puremagic.com wrote: It seems that D3 is

Re: Symbol lookup rules and imports

2014-12-08 Thread ketmar via Digitalmars-d
On Mon, 08 Dec 2014 19:40:38 -0800 Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: On 12/8/2014 7:34 PM, ketmar via Digitalmars-d wrote: On Mon, 08 Dec 2014 14:30:08 -0800 Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: The two-step lookup method, of

Re: D3

2014-12-08 Thread MachineCode via Digitalmars-d
On Monday, 8 December 2014 at 21:04:05 UTC, Idan Arye wrote: On Monday, 8 December 2014 at 20:21:51 UTC, Andrej Mitrovic via Digitalmars-d wrote: On 12/8/14, Russel Winder via Digitalmars-d digitalmars-d@puremagic.com wrote: It seems that D3 is already available:

Re: D3

2014-12-08 Thread Jeremy DeHaan via Digitalmars-d
On Tuesday, 9 December 2014 at 03:52:01 UTC, ketmar via Digitalmars-d wrote: On Mon, 08 Dec 2014 21:08:03 + Brad Anderson via Digitalmars-d digitalmars-d@puremagic.com wrote: On Monday, 8 December 2014 at 20:21:51 UTC, Andrej Mitrovic via Digitalmars-d wrote: On 12/8/14, Russel Winder

need new vector base gui write in d

2014-12-08 Thread rahim via Digitalmars-d-dwt
hello i think need new gui for work by d with designer please help to completed this concept --my english speaking and writing is no bad ,sorry for this-- features: *vector base *all element can convert to parents of element *have 6 data to use ,where element 1-left 2-top 3-right

how to access a ftp sever with socket

2014-12-08 Thread michael via Digitalmars-d-learn
Hello Anyone: i am trying make a ftp client with socket,i have tried std.net.curl,but i cont stand with so many try-catch structure in my code,i am not familiar with socket,i write a pecie of code but it cont give me the welcome message which i want,and then i use wireshark to trace the

Re: how to access a ftp sever with socket

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 8 Dec 2014 17:16:23 +0800 (CST) michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hello Anyone: i am trying make a ftp client with socket,i have tried std.net.curl,but i cont stand with so many try-catch structure in my code,i am not familiar with

Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program exited with code -11' (or a seg fault if executed from a terminal). The problem line is:

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 13:16:37 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: Sorted Array Wrapper Range

2014-12-08 Thread Nordlöw
On Sunday, 7 December 2014 at 13:12:06 UTC, Tobias Pankrath wrote: Something like this https://github.com/Panke/phobos/blob/std_container_sorted/std/container/sorted.d It should additionally support c.remove(r), c.removeKey(k), opIn and insertFront/removeFront if the underlying store

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:23:12 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 13:16:37 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 13:37:20 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The program now works from a terminal as expected (!) BUT when SDL_RenderCopy is called SDL_GetError() shows an 'error code' (or just some address/value as it is different each time).

Re: Derelict / SDL error

2014-12-08 Thread Mike Parker via Digitalmars-d-learn
On 12/8/2014 10:37 PM, Paul wrote: I added this around the problem line to catch the problem: try{ SDL_RenderCopy(renderer, texture, sourceRect, destRect); } catch{} finally { writeln( Error: , SDL_GetError() ); } The program now works from a terminal

Re: Delegate returning itself

2014-12-08 Thread Jonathan Marler via Digitalmars-d-learn
On Saturday, 6 December 2014 at 15:46:16 UTC, Adam D. Ruppe wrote: The problem is the recursive *alias* rather than the delegate. Just don't use the alias name inside itself so like alias MyDelegate = void delegate() delegate(); will work. The first void delegate() is the return value of the

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error: , to!string( SDL_GetError() )); Cleaner! Any ideas where to look for the source of the problem?

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:47:47 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 13:37:20 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: besides, i don't think that you'll get something sane from `SDL_GetError()` in the case of segfault.

Re: Delegate returning itself

2014-12-08 Thread Jonathan Marler via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:08:33 UTC, Jonathan Marler wrote: On Saturday, 6 December 2014 at 15:46:16 UTC, Adam D. Ruppe wrote: The problem is the recursive *alias* rather than the delegate. Just don't use the alias name inside itself so like alias MyDelegate = void delegate()

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 14:13:54 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error: , to!string( SDL_GetError() )); Cleaner! ah, sure. i just wanted to use libc's

Re: Delegate returning itself

2014-12-08 Thread via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:31:53 UTC, Jonathan Marler wrote: On Monday, 8 December 2014 at 14:08:33 UTC, Jonathan Marler wrote: On Saturday, 6 December 2014 at 15:46:16 UTC, Adam D. Ruppe wrote: The problem is the recursive *alias* rather than the delegate. Just don't use the alias name

Re: Accented Characters and Counting Syllables

2014-12-08 Thread Nordlöw
On Sunday, 7 December 2014 at 15:47:45 UTC, H. S. Teoh via Digitalmars-d-learn wrote: Ok, thanks. I just noticed that byGrapheme() lacks bidirectional access. Further it also lacks graphemeStrideBack() in complement to graphemeStride()? Similar to stride() and strideBack(). Is this difficult

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:35:17 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 14:13:54 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error: ,

Re: Accented Characters and Counting Syllables

2014-12-08 Thread Nordlöw
On Monday, 8 December 2014 at 14:57:06 UTC, Nordlöw wrote: What's the best source of information for these algorithms? Is it certain that graphemes iteration is backwards iteratable by definition? I guess https://en.wikipedia.org/wiki/Combining_character could be a good start.

Re: Sorted Array Wrapper Range

2014-12-08 Thread Tobias Pankrath via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:34:33 UTC, Nordlöw wrote: On Sunday, 7 December 2014 at 13:12:06 UTC, Tobias Pankrath wrote: Something like this https://github.com/Panke/phobos/blob/std_container_sorted/std/container/sorted.d It should additionally support c.remove(r), c.removeKey(k), opIn

Re: Derelict / SDL error

2014-12-08 Thread Jack via Digitalmars-d-learn
On Monday, 8 December 2014 at 12:53:11 UTC, Paul wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program exited with code -11' (or a seg fault if executed from

Re: Delegate returning itself

2014-12-08 Thread Jonathan Marler via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:38:37 UTC, Marc Schütz wrote: On Monday, 8 December 2014 at 14:31:53 UTC, Jonathan Marler wrote: On Monday, 8 December 2014 at 14:08:33 UTC, Jonathan Marler wrote: On Saturday, 6 December 2014 at 15:46:16 UTC, Adam D. Ruppe wrote: The problem is the recursive

Re: Delegate returning itself

2014-12-08 Thread Ali Çehreli via Digitalmars-d-learn
On 12/06/2014 07:28 AM, Jonathan Marler wrote: Is there a way to create a delegate that returns itself? Y combinator helps exactly with that: http://rosettacode.org/wiki/Y_combinator#D Copying the code from there: import std.stdio, std.traits, std.algorithm, std.range; auto Y(S, T...)(S

How do i use std.functional.binaryFun?

2014-12-08 Thread Gary Willoughby via Digitalmars-d-learn
How do i successfully use std.functional.binaryFun in the following example? import std.stdio; import std.functional; class Foo(T, alias greater = a b) if (is(typeof(binaryFun!(greater)(T.init, T.init)) == bool)) { private alias compare = binaryFun!(greater); public this()

Re: Sorted Array Wrapper Range

2014-12-08 Thread Nordlöw
On Monday, 8 December 2014 at 15:43:37 UTC, Tobias Pankrath wrote: Was my fault. The phobos checkout didn't match my dmd version. Here is my current state (has some more unittest, bugs fixed, no assignment via SortedRange views on Sorted.):

Re: Sorted Array Wrapper Range

2014-12-08 Thread Nordlöw
On Monday, 8 December 2014 at 15:43:37 UTC, Tobias Pankrath wrote: Was my fault. The phobos checkout didn't match my dmd version. Here is my current state (has some more unittest, bugs fixed, no assignment via SortedRange views on Sorted.):

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 17:48:55 UTC, Jack wrote: I'm running ArchLinux 64-bit on Vbox and tested out the code. There haven't been any problems. Have you tried updating whatever tools you're using?(dmd, dub, etc) Might've been an outdated piece of software that's been making the fuss.

Re: How do i use std.functional.binaryFun?

2014-12-08 Thread anonymous via Digitalmars-d-learn
On Monday, 8 December 2014 at 20:08:35 UTC, Gary Willoughby wrote: import std.stdio; import std.functional; class Foo(T, alias greater = a b) if (is(typeof(binaryFun!(greater)(T.init, T.init)) == bool)) { private alias compare = binaryFun!(greater); public this() {

Re: threading issues with D - C - Python

2014-12-08 Thread Michael via Digitalmars-d-learn
On Monday, 8 December 2014 at 01:17:16 UTC, Ellery Newcomer wrote: On 12/07/2014 03:12 PM, Michael wrote: On Saturday, 6 December 2014 at 00:40:49 UTC, Ellery Newcomer wrote: On 12/04/2014 10:55 PM, Ellery Newcomer wrote: I guess tomorrow I can try messing around with thread_attachThis, as

Re: @property usage

2014-12-08 Thread Nicholas Londey via Digitalmars-d-learn
as this can break some invalid code (the code where people using properties as functions) Does @property ever make sense for a free floating function? I would have thought no but was recently asked to add it if using the function with uniform call syntax.

Re: @property usage

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Tue, 09 Dec 2014 07:31:20 + Nicholas Londey via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: as this can break some invalid code (the code where people using properties as functions) Does @property ever make sense for a free floating function? I would have thought

[Issue 13833] New: .classinfo.name (and typeid(obj)) does not print proper dynamic type when using a templated interface

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13833 Issue ID: 13833 Summary: .classinfo.name (and typeid(obj)) does not print proper dynamic type when using a templated interface Product: D Version: D1 D2 Hardware: All

[Issue 13833] .classinfo.name (and typeid(obj)) does not print proper dynamic type when using a templated interface

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13833 --- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com --- This bug affects both D1 and D2. --

[Issue 13834] New: make levenshteinDistance @nogc

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13834 Issue ID: 13834 Summary: make levenshteinDistance @nogc Product: D Version: unspecified Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement

[Issue 11434] std.file.copy doesn't preserve file attributes (eg: executable mode etc)

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11434 --- Comment #3 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/49eae37265312ea19163da7a89612f08da344d3f Merge pull request

[Issue 13835] New: ICE in interpret.c:736 - Issue with static variables.

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13835 Issue ID: 13835 Summary: ICE in interpret.c:736 - Issue with static variables. Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: major

[Issue 13835] ICE in interpret.c:736 - Issue with static variables.

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13835 --- Comment #1 from Gary Willoughby d...@nomad.so --- Above was using DMD64 D Compiler v2.066.1 on Ubuntu 14.04 --

[Issue 13831] DMD crash

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13831 Mr. Smith mrsmit...@yandex.ru changed: What|Removed |Added Severity|major |critical --

[Issue 13836] New: DMD linker (v2.066) not working with older ld

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13836 Issue ID: 13836 Summary: DMD linker (v2.066) not working with older ld Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal

[Issue 13837] New: Named tuples with type inference

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13837 Issue ID: 13837 Summary: Named tuples with type inference Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1

[Issue 13837] Named tuples with type inference

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13837 Peter Alexander peter.alexander...@gmail.com changed: What|Removed |Added Assignee|nob...@puremagic.com

[Issue 13838] New: @safe by default

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13838 Issue ID: 13838 Summary: @safe by default Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: enhancement Priority: P1

[Issue 13839] New: Use new style for alias declarations in di files

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13839 Issue ID: 13839 Summary: Use new style for alias declarations in di files Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

[Issue 13832] delegates that return ref do not output correctly to .di file

2014-12-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13832 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull, wrong-code ---

<    1   2   3   >