Re: Voldemort Types in D

2012-05-11 Thread Andrej Mitrovic
On 5/9/12, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ Sorry, that won't work, the compiler will not allow a Voldemort Type to be instantiated outside of its scope (the technical reason is it has no reference

Re: Voldemort Types in D

2012-05-10 Thread Adam Wilson
On Wed, 09 May 2012 23:20:47 -0700, Jacob Carlborg d...@me.com wrote: On 2012-05-09 23:03, Timon Gehr wrote: The type cannot be inferred without full semantic analysis in general. Furthermore, it could be different based on compilation options (or maybe based on in what order the modules were

Re: Voldemort Types in D

2012-05-10 Thread deadalnix
Le 09/05/2012 21:23, Bernard Helyer a écrit : You've been busy! Looks like you've hit your 2 article limit. Log-in or register for a free account to get unlimited articles and full access to Dr. Dobb's. Sorry doctor, but I don't care about that other article that much. My god, Dr. Dobb's is

Voldemort Types in D

2012-05-09 Thread Andrei Alexandrescu
http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ Andrei

Re: Voldemort Types in D

2012-05-09 Thread deadalnix
Le 09/05/2012 16:30, Andrei Alexandrescu a écrit : http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ Andrei I read it. writeln(take(generator(5), 10)); = writeln(generator(5).take(10)); UFCS FTW ! Great reading BTW, and I love how ti is named.

Re: Voldemort Types in D

2012-05-09 Thread Nicolas Sicard
On Wednesday, 9 May 2012 at 14:30:33 UTC, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ Andrei One drawback of Voldemort types, is that they are incompatible with the generation of .di files (option -H). See

Re: Voldemort Types in D

2012-05-09 Thread Sean Kelly
On May 9, 2012, at 8:43 AM, deadalnix wrote: Great reading BTW, and I love how ti is named. I'd prefer Lovecraftian types :-) Good article though.

Re: Voldemort Types in D

2012-05-09 Thread Adam Wilson
On Wed, 09 May 2012 08:58:56 -0700, Nicolas Sicard dran...@gmail.com wrote: On Wednesday, 9 May 2012 at 14:30:33 UTC, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ Andrei One drawback of Voldemort types, is that they are incompatible

Re: Voldemort Types in D

2012-05-09 Thread Jonathan M Davis
On Wednesday, May 09, 2012 10:05:36 Adam Wilson wrote: On Wed, 09 May 2012 08:58:56 -0700, Nicolas Sicard dran...@gmail.com wrote: On Wednesday, 9 May 2012 at 14:30:33 UTC, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ Andrei

Re: Voldemort Types in D

2012-05-09 Thread Sean Kelly
On May 9, 2012, at 7:30 AM, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ One thing: and then use g. I know what you're thinking — use typeof and declare another instance of RandomNumberGenerator: auto g = generator(4); typeof(g) h;

Re: Voldemort Types in D

2012-05-09 Thread Adam Wilson
On Wed, 09 May 2012 10:19:08 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: On Wednesday, May 09, 2012 10:05:36 Adam Wilson wrote: On Wed, 09 May 2012 08:58:56 -0700, Nicolas Sicard dran...@gmail.com wrote: On Wednesday, 9 May 2012 at 14:30:33 UTC, Andrei Alexandrescu wrote:

Re: Voldemort Types in D

2012-05-09 Thread Jonathan M Davis
On Wednesday, May 09, 2012 10:41:31 Adam Wilson wrote: On Wed, 09 May 2012 10:19:08 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: On Wednesday, May 09, 2012 10:05:36 Adam Wilson wrote: On Wed, 09 May 2012 08:58:56 -0700, Nicolas Sicard dran...@gmail.com wrote: On Wednesday, 9

Re: Voldemort Types in D

2012-05-09 Thread Adam Wilson
On Wed, 09 May 2012 11:00:01 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: On Wednesday, May 09, 2012 10:41:31 Adam Wilson wrote: On Wed, 09 May 2012 10:19:08 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: On Wednesday, May 09, 2012 10:05:36 Adam Wilson wrote: On Wed, 09 May

Re: Voldemort Types in D

2012-05-09 Thread Bernard Helyer
You've been busy! Looks like you've hit your 2 article limit. Log-in or register for a free account to get unlimited articles and full access to Dr. Dobb's. Sorry doctor, but I don't care about that other article that much. My god, Dr. Dobb's is such a shit-hole. Walter's articles are their

Re: Voldemort Types in D

2012-05-09 Thread Jacob Carlborg
On 2012-05-09 20:54, Adam Wilson wrote: Nuts. It's CTFE. Because the implementation source is being stripped out, that was *THE* main request of DI files and they are pointless without that. Essentially DI files and CTFE are mutually exclusive. No, it's the same issue with templates and

Re: Voldemort Types in D

2012-05-09 Thread Jacob Carlborg
On 2012-05-09 19:05, Adam Wilson wrote: This pull fixes this problem and a bunch of others: https://github.com/D-Programming-Language/dmd/pull/928. However, it currently fails to build on Linux and fails the unittests on Windows thanks to a problem with the dur template function in

Re: Voldemort Types in D

2012-05-09 Thread Jacob Carlborg
On 2012-05-09 16:30, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/telhj/voldemort_types_in_d/ Andrei D also have some problems with voldemort types. As can be seen in a discussion in the main newsgroup, it's not possible to declare a function pointer which returns

Re: Voldemort Types in D

2012-05-09 Thread Jonathan M Davis
On Wednesday, May 09, 2012 22:11:20 Jacob Carlborg wrote: On 2012-05-09 20:54, Adam Wilson wrote: Nuts. It's CTFE. Because the implementation source is being stripped out, that was *THE* main request of DI files and they are pointless without that. Essentially DI files and CTFE are

Re: Voldemort Types in D

2012-05-09 Thread Timon Gehr
On 05/09/2012 10:09 PM, Jacob Carlborg wrote: On 2012-05-09 19:05, Adam Wilson wrote: This pull fixes this problem and a bunch of others: https://github.com/D-Programming-Language/dmd/pull/928. However, it currently fails to build on Linux and fails the unittests on Windows thanks to a problem

Re: Voldemort Types in D

2012-05-09 Thread Walter Bright
On 5/9/2012 1:35 PM, Jonathan M Davis wrote: Yeah. You _can_ strip them out (except for templates), but doing so restricts what you can do (in this case, killing inlining and CTFE). Personally, I think that it makes .di files essentially useless except in specific cases where you can't use CTFE

Re: Voldemort Types in D

2012-05-09 Thread Walter Bright
On 5/9/2012 10:11 AM, Sean Kelly wrote: If the struct were made static and given a ctor that seed were passed to, I imagine it would work, yes? It should work. But you'll run into another issue - transmitting that typeof *up* out of its scope.

Re: Voldemort Types in D

2012-05-09 Thread Jonathan M Davis
On Wednesday, May 09, 2012 14:06:10 Walter Bright wrote: On 5/9/2012 1:35 PM, Jonathan M Davis wrote: Yeah. You _can_ strip them out (except for templates), but doing so restricts what you can do (in this case, killing inlining and CTFE). Personally, I think that it makes .di files