Stefan Ram <ram@zedat.fu-berlin.de> 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
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607