Re: #f and '()

Paul R. Wilson (wilson@cs.utexas.edu)
Fri, 9 Aug 1996 12:37:22 -0500

>From jimb@cyclic.com Fri Aug 9 09:01:48 1996
>
>>At any rate, I think there should be a debugging mode that detects ambiguous
>>uses. This may require a separate build of the system to avoid significant
>>overhead in runtime use, but it's pretty trivial to implement and will
>>make debugging much easier.
>
>I would have no problem providing this sort of feature.
>

By the way, this is an example of something that's usually easier with a
compiler than with an interpreter.

I once changed Scheme-48 to accept '() as false, and it was a one-line
change to the code generation routine for IF. Since all conditionals
are implemented in terms of IF by transformation, that did the trick.

With a hand-tweaked interpreter this is likely to be harder, because
ifs are likely to be implicit in other code, which has to be identified
and changed.

We could do this for RScheme, too.

It actually wouldn't be hard to have a flag that tells the compiler
how to treat #f and '() in IFs, so that the same compiler could compile
code both ways for debugging purposes.

We had a similar experience recently in implementing our lexically-scoped
macro system. The main hook into the compiler for scope tricks turned
to be a one-line change in the low-level "bind" operation used (directly
or indirectly) by the compiler for all of the binding constructs in
the language.