Memory allocation purity
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Thu May 15 08:24:05 PDT 2014
On 5/15/14, 3:31 AM, luka8088 wrote:
> Yeah, I read all about weak/string purity and I do understand the
> background. I was talking about strong purity, maybe I should pointed
> that out.
>
> So, to correct myself: As I understood strong purity implies
> memoization. Am I correct?
Yes, as long as you don't rely on distinguishing objects by address.
Purity of allocation is frequently assumed by functional languages
because without it it would be difficult to get much work done. Then,
most functional languages make it difficult or impossible to distinguish
values by their address. In D that's easy. A D programmer needs to be
aware of that, and I think that's fine.
Andrei
More information about the Digitalmars-d
mailing list