Look and think good things about D
bearophile
bearophileHUGS at lycos.com
Fri Nov 15 02:57:40 PST 2013
qznc:
>> http://rosettacode.org/wiki/Look-and-say_sequence#D
>
> The fast version is nearly functional, too. Since memory
> management is not considered a side effect there is only the
> printfs. If the printfs are wrapped into "debug", the function
> is pure.
In a system that allows you a more fine-graded management of
effects through an algebra, memory allocation is an effect. It's
easy to show D functions annotated with "pure" that aren't pure
at all because of memory allocation.
Bye,
bearophile
More information about the Digitalmars-d
mailing list