|
![](/i/fill.gif) |
Warp wrote:
> Darren New <dne### [at] san rr com> wrote:
>> Warp wrote:
>>> I assume that means that Haskell doesn't handle objects (if it even has
>>> such a concept) by value, only by reference (which, in fact, isn't very
>>> surprising to me).
>
>> Semantically, this is a rather difficult question to answer for a purely
>> functional language where the data can't be mutated.
>
> Well, if eg. integers can be handled by value, why not user-defined
> objects?
There's no need to? Whether the language implements user objects as values
or as something pointed to makes no difference to the meaning of the
language. It's of course an efficiency trade-off, which is why I said it's
*semantically* difficult to answer.
Even if Haskell is passing around pointers to user objects, it's still not
pass-by-reference in the usual sense of the word, because the values are
immutable.
My comment might not have been 100% in line with what you were asking about.
I just thought it was an interesting point. In a language where you can't
modify memory once you've allocated it, is there any semantic difference
between allocating it on the heap or allocating it inline somewhere? I don't
think so.
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
![](/i/fill.gif) |