User loginNavigation |
Having trouble with 'purity'I am having trouble wrapping my mind around the semantics of a pure functional programming language. In writing my current programming language I chose to treat the variable assignment expression: x = 5 as the creation of a function named x. x = 5 is semantically equivalent to: x = fn () -> 5 Is this sort of 'variable assignment' considered to be an example of pure in the FP sense? NOTE: if x (in the above example) were to be redefined, a new closure would be created with the associated value. Sorry to ask such a trivial question, but I am having trouble finding semantic discussions concerning simple functional programming idioms. Best regards, M.J. Stahl By mjstahl at 2004-07-23 19:03 | LtU Forum | previous forum topic | next forum topic | other blogs | 6714 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 3 days ago
22 weeks 3 days ago
22 weeks 3 days ago
44 weeks 4 days ago
48 weeks 6 days ago
50 weeks 3 days ago
50 weeks 3 days ago
1 year 1 week ago
1 year 5 weeks ago
1 year 5 weeks ago