Re: Keyword abuse (Re: reduced size symbols/keywords)
- From: "John Thingstad" <jpthing@xxxxxxxxx>
- Date: Fri, 29 Aug 2008 16:18:52 +0200
På Fri, 29 Aug 2008 16:01:09 +0200, skrev Marco Antoniotti <marcoxa@xxxxxxxxx>:
Apart from all the previous comments which I agree with, there is an
issue that has been nagging me for some time. I see several libraries
(I won't name names!) that "abuse" keywords. The typical example is
the home brew HTML replacement that does the following
(:html (:head ...) (:body (:h1 ... (:ul ...))))
you get the idea.
I would advocate against this (and similar) use of keywords. Packaged
symbols are perfect for this kind of job.
Why is this abuse?
The idea of keywords is they are visible in all packages. Which in this case is exactly what you want.
(HTML:HTML (HTML:HEAD ...) (HTML:BODY...)
would be a real pain. After all HTML is typically in use on several packages and it is important that the refer to the same symbol.
If something unrelated to HTML uses the key like :body no harm is done.
If you have a 'body local to the package and a 'body in a different package they are not the same symbol.
This could cause errors.
It is far better to have it all in one place the KEYWORD package.
--------------
John Thingstad
.
- Follow-Ups:
- Re: Keyword abuse (Re: reduced size symbols/keywords)
- From: Tim Bradshaw
- Re: Keyword abuse (Re: reduced size symbols/keywords)
- References:
- reduced size symbols/keywords
- From: verec
- Keyword abuse (Re: reduced size symbols/keywords)
- From: Marco Antoniotti
- reduced size symbols/keywords
- Prev by Date: Keyword abuse (Re: reduced size symbols/keywords)
- Next by Date: Re: What do you LISPers think of Haskell?
- Previous by thread: Keyword abuse (Re: reduced size symbols/keywords)
- Next by thread: Re: Keyword abuse (Re: reduced size symbols/keywords)
- Index(es):
Relevant Pages
|