Re: Why is immutable not possible as a result of a reduce expression?

2013-01-06 Thread Andrej Mitrovic
On 1/6/13, Jonathan M Davis jmdavisp...@gmx.com wrote: If you or someone else It's going to have to be someone else. When someone asks something on IRC/NG and another person responds with it's because it's not a type constructor, or it's not a storage class I get completely thrown off and don't

Re: Why is immutable not possible as a result of a reduce expression?

2013-01-06 Thread Jonathan M Davis
On Sunday, January 06, 2013 21:59:32 Andrej Mitrovic wrote: On 1/6/13, Jonathan M Davis jmdavisp...@gmx.com wrote: If you or someone else It's going to have to be someone else. When someone asks something on IRC/NG and another person responds with it's because it's not a type constructor,

Why is immutable not possible as a result of a reduce expression?

2013-01-05 Thread Michael Engelhardt
Hi, just playing around with the functional capabilities of D. One concept of the pure functional programming is that variables should not be reassigned, so the best(?) way to assure this is using immutable: immutable auto gen = sequence!(n); immutable auto seq = take(gen,10);

Re: Why is immutable not possible as a result of a reduce expression?

2013-01-05 Thread Simen Kjaeraas
On 2013-52-05 20:01, Michael Engelhardt m...@mindcrime-ilab.de wrote: Hi, just playing around with the functional capabilities of D. One concept of the pure functional programming is that variables should not be reassigned, so the best(?) way to assure this is using immutable:

Re: Why is immutable not possible as a result of a reduce expression?

2013-01-05 Thread monarch_dodra
On Saturday, 5 January 2013 at 20:09:24 UTC, Simen Kjaeraas wrote: The reason is that ranges may not be immutable or const. Ranges need to be mutated (popFront) to be iterable, and your filtered range cannot be mutated, by virtue of being immutable. I'm surprised that seq and filtered work,

Re: Why is immutable not possible as a result of a reduce expression?

2013-01-05 Thread Ali Çehreli
On 01/05/2013 12:09 PM, Simen Kjaeraas wrote: A little details is that immutable auto is unnecessary, as immutable implies auto (the details are more complex, but that's the short version). It is true that the OP does not need auto when there is already immutable but does immutable really

Re: Why is immutable not possible as a result of a reduce expression?

2013-01-05 Thread Jonathan M Davis
On Saturday, January 05, 2013 16:18:51 Ali Çehreli wrote: On 01/05/2013 12:09 PM, Simen Kjaeraas wrote: A little details is that immutable auto is unnecessary, as immutable implies auto (the details are more complex, but that's the short version). It is true that the OP does not need

Re: Why is immutable not possible as a result of a reduce expression?

2013-01-05 Thread Ali Çehreli
On 01/05/2013 04:59 PM, Jonathan M Davis wrote: D's auto _is_ automatic type deduction like in C++11. It must have changed in the last couple of years. I see that the documentation is now different: http://dlang.org/attribute.html#auto It now says The auto attribute is used when there