[plt-scheme] representing environments in Java

From: John Clements (clements at brinckerhoff.org)
Date: Tue Feb 3 03:05:24 EST 2009

All right, I've asked what I consider to be the leading local Java  
expert, and he had no idea: what's the standard idiomatic way to  
represent environments in Java?

More specifically: in order to implement a simple interpreter, you  
need maps with functional update.  I spent about fifteen minutes  
poking around, and found absolutely no way to use the existing Java  
standard libraries to achieve this.  To the best of my knowledge, the  
only correct way to do this is by "rolling your own"; in essence,  
following the first few chapters of HtDC to create a List interface  
with two concrete subclasses, Cons and MT.

This seems like a ludicrous state of affairs: the standard libraries  
fail to contain any way to represent functional-update lists, despite  
the fact that such a thing would be about a hundred lines of extra  
code in a very large standard library. Surely I must be overlooking  
something obvious?


John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20090203/4a2b0d87/attachment.p7s>

Posted on the users mailing list.