3 ms·
> Immutable objects do not have identity and are values. Really? https://ideone.com/mmQJGr https://ideone.com/mmQJGr > And the distinction between primitives
by catnaroek 9y ago
> Immutable objects do not have identity and are values.
Really? https://ideone.com/mmQJGr https://ideone.com/mmQJGr
> And the distinction between primitives and objects in Java, for our discussion here, is irrelevant.
All it takes to disabuse you of this notion is a little bit of reflection.
> That Haskell can force purity via its laziness
This is not true. Purity is enforced via the type system.
> but not required for doing FP, just like how static types aren't required for doing FP either
Completely agree here.
> but they've been preceded by LISP and ML.
ML is a functional language. Scheme already forces you to squint your eyes a lot. Lisp is not a functional language by any stretch of the term's meaning.
- seanmcdirmid 9y agoEven if their encoding has identify, immutable value don’t need it. Languages like C# allow you to throw off identity altogether with pass/store by value structs.
- catnaroek 9y ago> Even if their encoding has identify, immutable value don’t need it. Values indeed don't have physical identities. The problem is that, when you use a language with pervasive object identities, the values you want only exist in your head, not in the semantics of the language you are using. > Languages like C# allow you to throw off identity altogether with pass/store by value structs. Please teach me how to define list or tree values in C#, sensei.