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

Re: datum comments of sweet-expressions

This page is part of the web mail archives of SRFI 110 from before July 7th, 2015. The new archives for SRFI 110 contain all messages, not just those from before July 7th, 2015.

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        cowan@xxxxxxxx
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