Email list hosting service & mailing list manager


Re: datum comments of sweet-expressions John Cowan 12 Jul 2013 14:10 UTC

David A. Wheeler scripsit:

> In Scheme and Common Lisp you could return (values), but that isn't
> really enough, because you then need to pass around "there is no value
> here" and determine if it's true or not.

That is exactly what is done by CL reader macro functions: they return
(values) when they wish to make no contribution to the S-expression
being constructed, or a single value when they do wish to contribute.

But I don't necessarily recommend that.  I think the EMPTY tag works
better.  However, I think the habit of using conses as unique tags
just makes debugging output hard to decipher.  I much prefer this style:

(define foo-tag (string-copy "foo"))

This is guaranteed to return a unique object.  In Common Lisp, this
is spelled:

(defconstant foo-tag (copy-seq "foo"))

--
John Cowan          http://www.ccil.org/~cowan        xxxxxx@ccil.org
To say that Bilbo's breath was taken away is no description at all.  There are
no words left to express his staggerment, since Men changed the language that
they learned of elves in the days when all the world was wonderful. --The Hobbit