Re: datum comments of sweet-expressions David A. Wheeler 12 Jul 2013 12:52 UTC

On Fri, 12 Jul 2013 10:14:53 +0800, Alan Manuel Gloria <xxxxxx@gmail.com> wrote:
> Haha more nasty tagging values hahahaha!  We never seem to get rid of them!

:-).

> ; unique tagging value
> (define EMPTY (cons '() '()))

Right.

The notion that a reader might find that a sequence of characters maps to
"no value at all" (distinct from (), "", and 0) isn't really that bizarre or nasty.
It's just that there's no standard way to represent it in Lisp.
Cue the Haskell'ers, who will tell me about "Maybe"....!
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 said, this "empty" would be entirely internal to the reader; if a value is
determined to be empty at the top level, we'll just recurse back and
try again (just as all readers do for comments).  So it's merely a convenience for
notation and implementation, not something users will see directly.

Again, if anyone has a better idea, I'm all ears.
My goal is "Simple as possible, but no simpler."

> Basically, our previous (before SRFI-110) implementations made use of
> lots of these objects.  There's even a dangling "special tag to denote
> comment return from hash-processing" which no longer comments anything
> at all, the special tag having been removed.

Whups!  Feel free to remove the obsolete code!

--- David A. Wheeler