Hacker News new | ask | show | jobs
by JonChesterfield 1305 days ago
If it's pure, there's no benefit to a list of forms in lambda. As only the last one would do anything. If define is a mutator, the language isn't pure. So 2 and 4 are in conflict.

Perhaps it is pure excepting the top level, where mutations such as define are permitted.

1 comments

Eh, that's just quibbling over the syntax. The `define` forms could be rewritten as `let` to make things look more "pure".

(The only situation where `define` might be considered "impure" is if it was used to redefine a variable that already existed in the same scope; and even then, it could still be considered "pure" as long as it created a new variable instead of mutating the original variable.)