Subject: Re: generating a new symbol from existing one
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 30 Mar 2005 06:26:47 -0600
Newsgroups: comp.lang.lisp
Message-ID: <LsudnZmR_4-aBtffRVn-tw@speakeasy.net>
Stormbringer <andreif@mail.dntis.ro> wrote:
+---------------
| I was wondering : is it possible to write a macro that changes a symbol
| x to something like 'x2', for example :
|    (change 'a)
|    a2
|    >>
| ... 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

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607