This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Keywords are procedures?


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/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]