Stormbringer <email@example.com> wrote:
| I was wondering : is it possible to write a macro that changes a symbol
| x to something like 'x2', for example :
| (change 'a)
| ... any hints ?
Hints (Socratic questions, really):
- What are the [externally-visible] constituents of a Common Lisp symbol?
What are the standard accessors for those constituents?
[Further hint: Look in the CLHS for all names beginning with "SYMBOL-".]
- Given the values of the constituents of a symbol, what exactly
would you want done to each one of them to transform it from the
original value into whatever it is you want your "change" to return?
- Given the values of some symbol constituents, how do you find/create
a [potentially new] symbol with those constituents?
- Having researched all the above in the CLHS, how would you package
it all up in one operation? And does it really have to be a macro?
[Further hint: No.]
Rob Warnock <firstname.lastname@example.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607