pika-dev
[Top][All Lists]
Advanced

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

Re: [Pika-dev] Keyword type?


From: Matthew Dempsky
Subject: Re: [Pika-dev] Keyword type?
Date: 27 May 2004 21:40:30 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Jose A Ortega Ruiz <address@hidden> 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




reply via email to

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