Pointers in Haskell??
Fri, 7 Dec 2001 17:07:52 GMT
The answers are making this question seem trickier than I'd thought it
was, because so far they (both) make it sound like structure-sharing
is tied very closely to names / variables. For instance:
> In Haskell, you can arrange for a large data structure to be shared by
> giving it a name, and then using the name wherever you'd use a pointer in
> some other language.
The idea here seems to be that you have a name that refers
specifically to the struccture you wish to share (as opposed
to needing only an expression whose value is that structure),
and then there are two possible interpretations:
One possible interpretation is: this is *a* way to get sharing,
to show that it's possible to have shared structures.
The other possible interpretation is: this is *the* (only) way
to do it.
What I'd expected was that it would suffice to have an expression
(and indeed that implementationally it would be much like Lisp or
Java so that values were always (except in exceptional cases)
secretly "pointers to".)