ark@research.att.com (Andrew Koenig) writes:
>Peter Ludemann <ludemann@inxight.com> writes:
>
>> But let's suppose that you really really really do need to identify a
>> particular subtree. In other words, you want to NAME it. No problem:
>> just create a dictionary (hash table) that maps names to subtrees.
>> That'll let you have two differently named entries which might happen
>> to have the same values. And it won't expose pointers. And it'll be
>> efficient.
>
>Yes and no. In a language that is completely referentially transparent,
>generating the names can be a problem, because there is no way to define
>a piece of code that represents the abstraction `Each time I build one of
>these nodes, I want it to have a globally unique label.' The language
>wouldn't be referentially transparent if I could write such a program.
>So the knowledge of the labels now has to pervade the entire system.
Martin Odersky has a nice solution to this problem --
a way to get globally unique labels in a local scope
without violating referential transparency, so that you
can do this sort of thing without the entire system needing to
know about the labels. See his paper on the lambda-nu calculus,
which is available from his home page (don't have a URL on-hand
right now, sorry). Unfortunately this has not yet been incorporated
into any existing programming language implementation, as far as
I am aware...
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
|