Re: Voldemort Types

2013-05-08 Thread Jonathan M Davis
On Wednesday, May 08, 2013 18:43:01 =?UTF-8?B?Ikx1w61z?=.Marques @puremagic.com wrote: > Hi, > > Regarding this article about Voldemort types: > > > http://www.drdobbs.com/cpp/voldemort-types-in-d/232901591?pgno=2 > > There's something I didn't understand. I

Re: Voldemort Types

2013-05-08 Thread Luís.Marques
On Wednesday, 8 May 2013 at 18:41:27 UTC, Jonathan M Davis wrote: It probably _should_ document that it's returning a range. Voldemort types just make it so that the exact type is unknown. So why not just declare "SomeRange generator()"? It still doesn't leak out the int

Re: Voldemort Types

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 20:46:55 UTC, Luís Marques wrote: On Wednesday, 8 May 2013 at 18:41:27 UTC, Jonathan M Davis wrote: It probably _should_ document that it's returning a range. Voldemort types just make it so that the exact type is unknown. So why not just declare "

Re: Voldemort Types

2013-05-08 Thread Jonathan M Davis
On Wednesday, May 08, 2013 22:46:53 =?UTF-8?B?Ikx1w61z?=.Marques @puremagic.com wrote: > On Wednesday, 8 May 2013 at 18:41:27 UTC, Jonathan M Davis wrote: > > It probably _should_ document that it's returning a range. > > Voldemort types > > just make it so that the exac

Re: Voldemort Types

2013-05-08 Thread H. S. Teoh
t's returning a range. > > > Voldemort types just make it so that the exact type is unknown. > > > > So why not just declare "SomeRange generator()"? It still doesn't > > leak out the internal struct and any automatic doc generator should > > have

Naming Voldemort Types

2015-06-25 Thread Nordlöw
I've noticed that the namings of lazy range voldemort types are inconsistent in Phobos. Some are named `XResult` others just `Result`, given that `x` is the parenting algorithm. What's the policy here? I would prefer the verbose `XResult` as it's more self documenting when deb

Re: Naming Voldemort Types

2015-06-25 Thread Steven Schveighoffer via Digitalmars-d
On 6/25/15 9:12 AM, "Nordlöw" wrote: I've noticed that the namings of lazy range voldemort types are inconsistent in Phobos. Some are named `XResult` others just `Result`, given that `x` is the parenting algorithm. What's the policy here? I would prefer the verbose `XResul

Re: Naming Voldemort Types

2015-06-25 Thread via Digitalmars-d
On Thursday, 25 June 2015 at 13:59:14 UTC, Steven Schveighoffer wrote: iI would like to see pragma(msg, typeof(r)) print something like functionThatReturnsVoldemort.Result That doesn't sound like too hard to implement... :)

Re: Naming Voldemort Types

2015-06-25 Thread Andrei Alexandrescu via Digitalmars-d
On 6/25/15 6:12 AM, "Nordlöw" wrote: I've noticed that the namings of lazy range voldemort types are inconsistent in Phobos. Some are named `XResult` others just `Result`, given that `x` is the parenting algorithm. What's the policy here? I would prefer the verbose `XResul

Re: Naming Voldemort Types

2015-06-25 Thread Walter Bright via Digitalmars-d
On 6/25/2015 11:54 AM, Andrei Alexandrescu wrote: On 6/25/15 6:12 AM, "Nordlöw" wrote: I've noticed that the namings of lazy range voldemort types are inconsistent in Phobos. Some are named `XResult` others just `Result`, given that `x` is the parenting algorithm. What's

Re: Naming Voldemort Types

2015-06-25 Thread Tofu Ninja via Digitalmars-d
On Thursday, 25 June 2015 at 13:12:18 UTC, Nordlöw wrote: I've noticed that the namings of lazy range voldemort types are inconsistent in Phobos. Some are named `XResult` others just `Result`, given that `x` is the parenting algorithm. What's the policy here? I would prefer t

Re: Naming Voldemort Types

2015-06-25 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 25 June 2015 at 20:58:41 UTC, Walter Bright wrote: On 6/25/2015 11:54 AM, Andrei Alexandrescu wrote: Result. No stuttering please. -- Andrei Also, consider that the mangled name includes the parent algorithm name. Let's not make mangled names excessively large, even if it is

Voldemort Types on Reddit

2016-09-10 Thread Walter Bright via Digitalmars-d
https://www.reddit.com/r/programming/comments/523hm3/til_the_d_language_has_a_voldemort_type/

Re: Voldemort Types on Reddit

2016-09-11 Thread Jack Stouffer via Digitalmars-d
On Saturday, 10 September 2016 at 20:39:39 UTC, Walter Bright wrote: https://www.reddit.com/r/programming/comments/523hm3/til_the_d_language_has_a_voldemort_type/ Boy oh boy, I just love in every D thread how we get the "my language can do this too" arguments followed by everyone showing how

Re: Voldemort Types on Reddit

2016-09-11 Thread Walter Bright via Digitalmars-d
On 9/11/2016 3:11 AM, Jack Stouffer wrote: On Saturday, 10 September 2016 at 20:39:39 UTC, Walter Bright wrote: https://www.reddit.com/r/programming/comments/523hm3/til_the_d_language_has_a_voldemort_type/ Boy oh boy, I just love in every D thread how we get the "my language can do this too"

Re: Voldemort Types on Reddit

2016-09-11 Thread Basile B. via Digitalmars-d
On Sunday, 11 September 2016 at 11:31:55 UTC, Walter Bright wrote: On 9/11/2016 3:11 AM, Jack Stouffer wrote: On Saturday, 10 September 2016 at 20:39:39 UTC, Walter Bright I just like a D post with 1166 upvotes! I think that's a record for us, but maybe one of Andrei's got more? And I do love

Re: Voldemort Types on Reddit

2016-10-13 Thread Harry Potter via Digitalmars-d
On Saturday, 10 September 2016 at 20:39:39 UTC, Walter Bright wrote: https://www.reddit.com/r/programming/comments/523hm3/til_the_d_language_has_a_voldemort_type/ then what is a "Harry Potter" type ? or (abhor!!!) a "Piton" type ? (not Python, I do not want to risk my neck mentioning Python

Understanding the D memory model re: Voldemort types

2015-04-09 Thread Matt Kline via Digitalmars-d
I have a bit of confusion about the D memory model when it comes to returning nested classes (i.e. "Voldemort types") and am hoping someone can take a minute to clear it up. Consider the following short program: auto foo() { import std.random; import std.conv; auto i

Re: Understanding the D memory model re: Voldemort types

2015-04-09 Thread H. S. Teoh via Digitalmars-d
On Thu, Apr 09, 2015 at 06:08:17PM +, Matt Kline via Digitalmars-d wrote: [...] > auto foo() > { > import std.random; > import std.conv; > > auto i = dice(0.5, 0.5); > string s = "Hello, scopes"; > > class Bar { > string what() { return s ~ " " ~ i.to!string; } >

Re: Understanding the D memory model re: Voldemort types

2015-04-09 Thread Matt Kline via Digitalmars-d
On Thursday, 9 April 2015 at 18:15:16 UTC, H. S. Teoh wrote: The compiler detects when a variable is being closed over by a nested function, and allocates them on the heap instead of the stack. Is there somewhere I can read more about this (besides the compiler source code)? What ramificatio

Re: Understanding the D memory model re: Voldemort types

2015-04-09 Thread Steven Schveighoffer via Digitalmars-d
compiler source code)? What ramifications are there for local variables being closed over that have destructors? Does the Voldemort object then get implicit destructor code that destroys the closed-over variables when it falls out of scope? It's called a closure. It's not specific to volde