guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #f and '() (was: Re: JACAL, scm)


From: Tom Lord
Subject: Re: #f and '() (was: Re: JACAL, scm)
Date: Tue, 25 Sep 2001 16:49:06 -0700 (PDT)

      A much more important reason is that #f and '() are two totally
      orthogonal concepts.

Legions of lisp programmers disagree, and here is an explanation of
why: "nil" is a stateless, unique value intended to be used in control
structures.  As a consequence of that use, it is a serendipitous
choice of value to represent "the empty list" and other leaf-cases of
recursively defined data structures.

Sometimes it is useful to define other stateless, unique values to be
used as leaf-cases of recursively defined data structures.  When
that's necessary, you can define predicates to test for those values.

Taking this approach, there is a default choice of stateless, unique
value ("nil") which is optimized (for conciseness of expression) in
the sense of being understood by control structures.  When you want
more such values (and why stop at just one?), you can construct as
many as you like.



        the more important point remains the semantic difference
        between the two concepts.

That semantic difference is an arbitrary choice, not a fundamental 
fact of the universe.



       The way it's planned, GNU Emacs will adopt Guile as it's
       extension language.

       [....]

       When you're concerned about interoperability with elisp, we'll
       have a language wrapper for this, which will provide the
       necessary equivalent of nil and () in elisp.

That is not a good plan.  It ruins Scheme `eq?' and Emacs lisp `eq' by
making them different, for example.  It makes elisp `listp' and Scheme
`list?' different.  It encourages people to write Scheme code which
relies on a distinction between #f and () -- such code won't
interoperate cleanly with elisp code.

The plan to use Guile in GNU Emacs is, I think it is safe to say, at
this point, a very long term plan at best.  In the mean time, Emacs
in its current form should be useful as an easy-to-adapt front-end to 
Guile programs.

-t



reply via email to

[Prev in Thread] Current Thread [Next in Thread]