(I am making the simplifying assumption that identity is solved by magical hand-waving)
Conversation
Pass-by-value means a different thing than pass-by-ref. It makes a copy each time. Sometimes you want a copy; sometimes you don't.
1
right, but assume the language can assign either semantic to any particular pass.
1
How does the language know which the caller means?
2
it *decides* which the caller means. Like I said, identity is hand-waved away. Aside from that it’s optimization.
1
*squiiiiiiint* I don't see how you can hand wave identity away
1
1
pretend it’s by magic up to and possibly including the elimination of state.
1
(for example, you could limit it to any pure type)
1
Okay, so for any immutable type, yes, this makes sense.
2
That's a pretty major limitation tho. You're restricting to the subset where pass-by- semantics no longer matter.
1
Replying to
Would create more of a motivation to use more immutable types, though, which is nice. ;)
Replying to
I mean, that’s basically the point. The stronger your guarantees, the more the compiler has to work with.


