Re: Keyword type?

Matthew Dempsky <[email protected]> 27 May 2004 21:40:30 -0500
Newsgroups gmane.lisp.scheme.pika.devel
Message-ID <[email protected]>
Jose A Ortega Ruiz <jao-mXXj517/[email protected]> writes:

> My vote goes for #:foo (I don't see the point of violating R5RS), although,
> on purely aestetical grounds, I'd use foo:

>From src/systas/libsystas/kw.c:

/************************************************************************
 *(h1 "Rationale -- Keywords")
 * 
 * A self-evaluating, disjoint, symbol-like type with a convenient
 * read/write syntax is exactly what is needed for two purposes:
 * keyword arguments and structure-like lists.
 * 
 * Some recent implementations provide keywords, but use a different
 * syntax, putting the colon at the end of the keyword name:
 * 
 * 	Systas keyword:			Some other implementations:
 *	-----------------------------------------------------------
 * 	:editor				editor:
 * 
 * That other syntax emphasizes that keywords are sometimes used
 * to tag the value that follows in a list:
 *
 *	:editor "/bin/ed"		editor: "/bin/ed"
 * 
 * However, there are two serious problems with the other syntax.
 * First, it breaks the general rule that a Scheme reader can 
 * recognize the type of a value being read by looking at a 
 * prefix of the syntax.  Second, it creates visual confusion when 
 * keywords are used on their own, not tagging any value at all,
 * such as the keyword `bg' in these examples:
 * 
 *	:bg :editor "/bin/ed"		bg: editor: "/bin/ed"
 * 
 */

-jivera