[alicebot-archcomm] [VOTE] Attribute var
John Foderaro
alicebot-archcomm@list.alicebot.org
Thu, 14 Mar 2002 09:06:08 -0800
I'll vote NO
reason:
you want to change
<set name="name">Dorothy</set>.
to
<set var="name">Dorothy</set>
but what you really want is this:
<set-var name="name">Dorothy</set-var>.
this says: set the value of the variable named "name" to "Dorothy".
I see this:
<set var="name">Dorothy</set>
as saying: set the variable that is the value of the variable "name"
to Dorothy.
In Lisp <set> is the function set and <set-var> is called setq.
setq says: quote the first argument (quoting prevents evaluation)
cl-user(10): (setq a 3)
3
cl-user(11): a
3
If you use set you have to do the quoting youself
cl-user(12): (set 'a 4)
4
cl-user(13): a
4
so here we set one symbol to have as its value another:
cl-user(14): (setq fred 'brother)
brother
cl-user(15): fred
brother
this is <set var="fred">joe</set>
cl-user(16): (set fred 'joe)
joe
note that it doesn't change the value of fred
cl-user(17): fred
brother
but it does change the value of the symbol that's the
value of fred:
cl-user(18): brother
joe
cl-user(19):