[CSG111] MP4: what happens when?


Subject: [CSG111] MP4: what happens when?
From: Mitchell Wand (wand@ccs.neu.edu)
Date: Mon Feb 09 2004 - 07:47:02 EST


A student wrote:

> I'm struggling with the pack and unpack implementation in the lexical
> translator.
> How is the 'pair' datatype represented after translation...
> I'm actually so confused it is hard to formulate a question.
>
> Basically, I think I can't figure out whether I should build and
> destructure my pair before or after translation.

and Owen replied:

> The actual creation of pair objects is going to happen after
> translation. When you run the translator, the only thing you're doing is
> getting rid of all of the variables in the system.

> You have to explore the expressions inside the pack to check for
> variables and bind them to their lexical scope, but the pack command
> itself doesn't create any new layers of lexical addresses.

> Where the fun begins is when you use the unpack command. That creates a
> new layer of lexical addresses with the two variables described in the
> unpack statement bound there. Anything within the scope there needs to
> take into account that layer of addresses.

> Hopefully this clarifies things a little.

_______________________________________________
csg111 mailing list
csg111@lists.ccs.neu.edu
https://lists.ccs.neu.edu/bin/listinfo/csg111



This archive was generated by hypermail 2b28 : Tue Feb 27 2007 - 19:00:11 EST