[plt-scheme] representing environments in Java

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Feb 3 10:34:57 EST 2009

0. Specify something for which you can also download a library from  
one of the recommended sites.

1. Introduce the standard data structures. It's a nice assignment.

2. Make students swap their library with one from a site.

3. Have them then implement an imperative environment, and have   
theme explain the changes to the API and what it implies and the  
difficulties. (They are likely to fail, which should create a nice  
teaching moment.)

-- Matthias









On Feb 3, 2009, at 7:32 AM, Robby Findler wrote:

> On Tue, Feb 3, 2009 at 2:05 AM, John Clements  
> <clements at brinckerhoff.org> wrote:
>> 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.
>
> You could use a hashmap and the clone method, ie isntead of just
> calling 'add' call 'clone' and then 'add'.
>
> Not sure about performance relative to an assoc, tho.
>
> Robby
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.