www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Naming Voldemort Types

reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
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 debugging or using for instance pragma(msg, 
typeof(r)) where `r` is an instance of a lazy range.

What do you guys think?
Jun 25 2015
next sibling parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
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 `XResult` as it's more self documenting when
 debugging or using for instance pragma(msg, typeof(r)) where `r` is an
 instance of a lazy range.

 What do you guys think?
I think the actual name you use for a voldemort type is of no importance. I would like to see pragma(msg, typeof(r)) print something like functionThatReturnsVoldemort.Result -Steve
Jun 25 2015
parent "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> writes:
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... :)
Jun 25 2015
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
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 `XResult` as it's more self documenting when
 debugging or using for instance pragma(msg, typeof(r)) where `r` is an
 instance of a lazy range.

 What do you guys think?
Result. No stuttering please. -- Andrei
Jun 25 2015
parent reply Walter Bright <newshound2 digitalmars.com> writes:
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 the policy here?

 I would prefer the verbose `XResult` as it's more self documenting when
 debugging or using for instance pragma(msg, typeof(r)) where `r` is an
 instance of a lazy range.

 What do you guys think?
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 an implementation problem that we should address on its own anyway.
Jun 25 2015
parent "Jonathan M Davis" <jmdavisProg gmx.com> writes:
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 an implementation problem that we should address on its own anyway.
It makes sense when we've been forced to make it so that the type isn't actually Voldemort type (e.g. FilterResult is a private struct outside of filter), but when it's actually a Voldemort type, Result should work just fine. - Jonathan M Davis
Jun 25 2015
prev sibling parent "Tofu Ninja" <emmons0 purdue.edu> writes:
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 the verbose `XResult` as it's more self 
 documenting when debugging or using for instance pragma(msg, 
 typeof(r)) where `r` is an instance of a lazy range.

 What do you guys think?
I always name my Voldemort Types tomRiddle...
Jun 25 2015