[plt-scheme] boxes?
On Jan 23, 2007, at 5:42 PM, Carl Eastlund wrote:
> The problem here is not that numbers and lists work differently, but
> that lists and *variables* work differently. The (set! ...) form
> works on variables, not values; the set-car! form works on values. It
> would be possible to implement integers that had a "set-integer!"
> procedure, so you could modify an integer as it was passed around, but
> that's not the same as set!.
Fair enough, but my point (rather a trivial one, perhaps) was that
the similarities in syntax can be confusing.
My understanding (right or wrong) is that (set! x 4) changes the
binding of the nearest enclosing x to 4. At least that's how I
implemented it in my evaluator.
FWIW, What I've been trying to do is experiment with evaluation and
reduction strategies. Reading SICP, I was impressed by how all the
various functions eval-if, eval-define, eval-sequence, etc. resembled
a semantic description of the language, so I decided to rewrite the
evaluators (for practice) and experiment with how I can manage code
re-use (something that's proving harder than I expected). I also want
to try experimenting with type systems and such. Oh, and I never did
really say why I started thinking about boxes. This may sound
ridiculous, but in the language I'm used to using in my "day job" it
is possible to share variables between separate processes. Does that
make any sort of sense in a functional context? Maybe. I have in mind
a kind of memory object that receives messages from parallel
processes (interleaved in some fashion) that will result in
environment updates (not the same kind of environment as the set of
bindings used by an evaluator). I'm also trying to wrap my brain
around how this could work with reduction semantics. I did download,
and am reading, PLAI.
Gregory Woodhouse
gregory.woodhouse at sbcglobal.net
"Those who are enamored of practice
without theory are like a pilot who goes
into a ship without rudder or compass."
--Leonardo da Vinci (1452-1519)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070123/03ffb9e1/attachment.html>