Memory allocation purity

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu May 15 14:52:51 PDT 2014


On 05/15/2014 08:03 PM, Andrei Alexandrescu wrote:
>>>
>>> Purity of allocation is frequently assumed by functional languages
>>
>> Examples?
>
> cons 1 2 is equal to cons 1 2
> ...

I don't see anything whose specification would need to mention 'allocation'.

>>> because without it it would be difficult to get much work done.
>>
>> Why?
>
> It's rather obvious. You've got to have the ability to create new values
> in a pure functional programming language.

This kind of operational reasoning is not essential. Of course, in 
practice you want to evaluate expressions, but the resulting programs 
are of the same kind as those of a non-pure language, and can do the 
same kind of operations. There is not really a distinction to be made at 
that level of abstraction.


More information about the Digitalmars-d mailing list