This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Keywords are procedures?
- From: Per Bothner <per at bothner dot com>
- To: Dominique Boucher <dboucher at nuecho dot com>
- Cc: "'Kawa List'" <kawa at sources dot redhat dot com>
- Date: Wed, 10 Dec 2003 18:40:35 -0800
- Subject: Re: Keywords are procedures?
- References: <001601c3bf8d$77b1f0b0$6400a8c0@Forman>
Dominique Boucher wrote:
Hi,
Is it normal that
(procedure? foo:) => #t
??
I try to pretty-print lists containing keywords and all the keywords are
printed as “#[procedure]”.
I don't know if it is normal, but it is a "feature". The idea is to
allow nice syntax for constructing XML data sets:
(foo:bar attr1: "x" foo:attr2: "y" "value1" (:baz "value2"))
corresponds to:
<foo:bar attr1="x" foo:attr2="y">value1<baz>value2</baz></foo:bar>
This only partially works, and may not be a good idea. Certainly,
the implementation is rather kludgy. Making keywords be
prcedures made it easier to implement this.
So for now, keywords are procedures, but don't count it that remaining
true. By the way: symbols in Common Lisp and Emacs Lisp (but not
Scheme) are also procedures.
--
--Per Bothner
per@bothner.com http://per.bothner.com/