about const and immutable (again)

2011-10-06 Thread Gor Gyolchanyan
Hi, guys. I just made my handy parsing struct take an arbitrary range, instead of a dstring and immediately rain head-first into a brick wall of errors. There's this function: bool next(bool function(ElementType!InputType) pred) , where InputType is bound to be dstring and which gets called

Re: about const and immutable (again)

2011-10-06 Thread Gor Gyolchanyan
Almost forgot: the same question holds for const. On Thu, Oct 6, 2011 at 6:56 PM, Gor Gyolchanyan wrote: > Hi, guys. > > I just made my handy parsing struct take an arbitrary range, instead > of a dstring and immediately rain head-first into a brick wall of > errors. > > There's this function: >

Re: about const and immutable (again)

2011-10-06 Thread Steven Schveighoffer
On Thu, 06 Oct 2011 10:56:43 -0400, Gor Gyolchanyan wrote: Hi, guys. I just made my handy parsing struct take an arbitrary range, instead of a dstring and immediately rain head-first into a brick wall of errors. There's this function: bool next(bool function(ElementType!InputType) pred)

Re: about const and immutable (again)

2011-10-06 Thread Gor Gyolchanyan
I see. Thanks for the detailed answer. I love D's support for functional programming. Everything about it, except the readability of function and delegate literals: * Function and delegate literals are way too long because of the "function" and "delegate" keywords being too long to be used insi

Re: about const and immutable (again)

2011-10-06 Thread Steven Schveighoffer
On Thu, 06 Oct 2011 12:27:16 -0400, Gor Gyolchanyan wrote: I see. Thanks for the detailed answer. I should clarify one point, I realized I am somewhat inaccurate on the reason the type is set to immutable(dchar). In fact, nobody actually wrote the immutable(dchar) function, it's just t

Re: about const and immutable (again)

2011-10-09 Thread Gor Gyolchanyan
Also, this would be a whole lot easier if D got a full built-in tuple support, because then all functions would always take a single argument. :-) On Thu, Oct 6, 2011 at 10:56 PM, Steven Schveighoffer wrote: > On Thu, 06 Oct 2011 12:27:16 -0400, Gor Gyolchanyan > wrote: > >> I see. Thanks for th

Re: about const and immutable (again)

2011-10-10 Thread Don
On 06.10.2011 20:56, Steven Schveighoffer wrote: On Thu, 06 Oct 2011 12:27:16 -0400, Gor Gyolchanyan wrote: I see. Thanks for the detailed answer. I should clarify one point, I realized I am somewhat inaccurate on the reason the type is set to immutable(dchar). In fact, nobody actually wrote

Re: about const and immutable (again)

2011-10-10 Thread Andrei Alexandrescu
On 10/10/11 5:55 PM, Don wrote: On 06.10.2011 20:56, Steven Schveighoffer wrote: On Thu, 06 Oct 2011 12:27:16 -0400, Gor Gyolchanyan wrote: I see. Thanks for the detailed answer. I should clarify one point, I realized I am somewhat inaccurate on the reason the type is set to immutable(dchar

Re: about const and immutable (again)

2011-10-10 Thread Don
On 11.10.2011 03:29, Andrei Alexandrescu wrote: On 10/10/11 5:55 PM, Don wrote: On 06.10.2011 20:56, Steven Schveighoffer wrote: On Thu, 06 Oct 2011 12:27:16 -0400, Gor Gyolchanyan wrote: I see. Thanks for the detailed answer. I should clarify one point, I realized I am somewhat inaccurate

Re: about const and immutable (again)

2011-10-11 Thread Steven Schveighoffer
On Mon, 10 Oct 2011 21:29:08 -0400, Andrei Alexandrescu wrote: On 10/10/11 5:55 PM, Don wrote: On 06.10.2011 20:56, Steven Schveighoffer wrote: On Thu, 06 Oct 2011 12:27:16 -0400, Gor Gyolchanyan wrote: I see. Thanks for the detailed answer. I should clarify one point, I realized I am

Re: about const and immutable (again)

2011-10-11 Thread Gor Gyolchanyan
assert(is(typeof(&foo) : void function(int)); On Tue, Oct 11, 2011 at 6:35 PM, Steven Schveighoffer wrote: > On Mon, 10 Oct 2011 21:29:08 -0400, Andrei Alexandrescu > wrote: > >> On 10/10/11 5:55 PM, Don wrote: >>> >>> On 06.10.2011 20:56, Steven Schveighoffer wrote: On Thu, 06 Oct 201