Re: another wish: checking for unbound identifiers

From: Lars Thomas Hansen <lth_at_cs.uoregon.edu>
Date: Sun, 28 Apr 1996 14:37:58 -0700

>Since Scheme is a statically scoped language, it's possible to check,
>before executing a piece of code, whether all the identifiers are bound or
>not. For example, the code
>
> (define (f n)
> (let ((mistake 0))
> (set! mistak (+ mistake n))))
>
>has a typo ("mistak" rather than "mistake") that won't be discovered until
>f is called. (I realize that because of eval and eval-string, it's possible
>that "mistak" could get bound before f is called, but this isn't in the
>spirit of Scheme.)

I'm not sure what you think of as "the spirit of Scheme" here; clearly,
in any interactive system that allows Scheme expressions to be entered
and evaluated in such a way that they can affect the top-level bindings
(i.e., nearly all Scheme systems) the above can be part of a perfectly
valid program, and "the spirit of Scheme" seems to me to encourage this
interpretation.

That said, I agree that such a utility would be extremely useful.
Developing one was on my to-do list until I realized that the DrScheme
environment developed at Rice might have the functionality desired. I
have yet to look at DrScheme but you might want to:

        http://www.cs.rice.edu/CS/PLT/packages/drscheme

Any useful utility needs to do whole-program analysis and needs to make
assumptions about interactivity, but I imagine we can deal with both.

--lars
Received on Sun Apr 28 1996 - 23:40:12 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST