Subject: Re: "attributes" in S-expressions
From: (Rob Warnock)
Date: Fri, 19 Aug 2005 02:18:46 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Stefan Ram <> wrote:
| I have seen several ways to annotate S-expressions with "attributes":
| (example (name "value") (name1 "value1"))
| (example (name -> "value") (name1 -> "value1"))
| (example ((name "value") (name1 "value1")))
| (example '((name "value")(name1 "value1")))
| (example '(name "value" name1 "value1"))
| (example name: "value" name1: "value1" )
| (example :name "value" :name1 "value1" )
| (example 'name "value" 'name1 "value1")

Still another way, used by some of the HTML generators (HTOUT,
CL-WHO, &c.), is to say that if the S-expr has "attributes",
then the CAR of the S-expr is itself a list, with the "real"
keyword in the CAAR. Then the attributes are stored as a property
list in the CDAR (as in HTML style). That is, given:

  (example this is some text)

the to indicate that the words should have their first letters
capitalized [as with STRING-CAPITALIZE] and be painted red, one
might say:

  ((example :case :capitalize :font "red") this is some text)

This works as long as your data format expects a "keyword"
[with or without "attributes"] as the CAR of each S-expr.


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607