Posted by: leppie | August 15, 2007

Scoping problems solved (mostly)

From reading the Scheme Language ‘spec’, they made an interesting comment on the handling of let. Basically a let can be rewritten as a lambda invocation expression, and hence that takes care of the scope, as a method stub gets created.

(let ((x (* 3 4))) (+ x x)) => ((fn (x) (+ x x)) (* 3 4))

This yields exactly the same result and is semantically the same.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: