From: Pascal Bourguignon
Subject: Re: changing a symbol name
Date: 
Message-ID: <87sm8hnqqn.fsf@thalassa.informatimago.com>
"Christophe Turle" <······@nospam.com> writes:
> > You're calling for deep trouble. (Hint: Symols are part of a program
> > source code.)
> 
> Symbols are but why their name are ? symbol & name should be distinct.

(defparameter a :a)
(defparameter b :b)
(setf (symbol-name 'a) "B")
(print b)
==> ?

The essence of a symbol is in its name, symbols must be distinct from
other symbols. Symbol is one to its name.
 
> > What is it that you actually want to do?
> 
> I want to rename all lisp symbols to their downcase counter part. I found
> this way to correct the bad reader uppercase convention : we write symbols
> in lower-case but as mentionned here a few days ago, we still use upper-case
> conversion for backward compatibility :(

Check readtable-case
http://www.lispworks.com/reference/HyperSpec/Body/f_rdtabl.htm 

> The trouble arises when you need to mingle your code with preserve case code
> (like java). You have to use ugly '|' syntax to make all work together. And
> all that overhead because of old choices.
> 
> 
> Note that this is also useful when you change your mind about the name of a
> function, macro, variable or better : something you don't know all sub
> layers ...

1- use an EDITOR!!!

2- see SUBST, for example:

        (subst 'good-name 'bad-name '(defun fun (bad-name other-name)
                                          (+ bad-name other-name)))

        ==> (DEFUN FUN (GOOD-NAME OTHER-NAME) (+ GOOD-NAME OTHER-NAME))

3- but what implementation are you using that keep the source of the
   program in core?  Even clisp, mangle the source a lot:

CL-USER> (fdefinition 'fun)
#<CLOSURE FUN (BAD-NAME OTHER-NAME) (DECLARE (SYSTEM::IN-DEFUN FUN))
  (BLOCK FUN (+ BAD-NAME OTHER-NAME))>
CL-USER> (function-lambda-expression 'fun)
(LAMBDA (BAD-NAME OTHER-NAME) (DECLARE (SYSTEM::IN-DEFUN FUN))
 (BLOCK FUN (+ BAD-NAME OTHER-NAME)))
#(NIL NIL NIL NIL ((DECLARATION VALUES OPTIMIZE DECLARATION)))
FUN

What guarantee do you have that if you substitute in the
function-lambda-expression, the change will be applied to the function
closure?

4- Don't be silly, use an EDITOR.

                        

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Voting Democrat or Republican is like choosing a cabin in the Titanic.

From: Gareth McCaughan
Subject: Re: changing a symbol name
Date: 
Message-ID: <87d5zkj38v.fsf@g.mccaughan.ntlworld.com>
Christophe Turle wrote:

[Pascal Bourguignon:]
> > The essence of a symbol is in its name
> >, symbols must be distinct from
> > other symbols. Symbol is one to its name.

[Christophe:]
> For you perhaps, but this is not the case of people like me who see symbols
> as concepts. Do you know about "le triangle s�miotique : r�f�rent, signifi�,
> signifiant".
...
> - Concepts and names are not the same. One concept may even have different
> names. Else we were all speaking the same language (human ones).
> 
> - The name is just a "pointer" to the symbol. A way to reference it.

Indeed, concepts and names are not the same. But concepts and
symbols are not the same either. Why do you expect symbols to
behave more like concepts than like names?

> - you can change a name by an other and your program will still behave the
> same way. If you change a concept from an other, it won't work the same way.

This is not a helpful test for the purpose of deciding
whether symbols are like names or like concepts, because
(as you have discovered) you can't make the sort of change
to symbols that you want to make :-).

>>> I want to rename all lisp symbols to their downcase counter
>>> part. I found this way to correct the bad reader uppercase
>>> convention : we write symbols in lower-case but as mentionned
>>> here a few days ago, we still use upper-case conversion for
>>> backward compatibility :(

Well, you want something that Lisp offers no way to do.
You'd have the same problem if you were writing in C++
and wanted a way to make it treat identifiers case-insensitively,
or if you were writing in Fortran and wanted a way to make it
dynamically typed. Actually, a better analogy: it's as if
you were writing in just about any language and wanted to
replace all its keywords with Japanese translations -- and
weren't prepared to accept solutions involving macro
preprocessors, new namespaces, etc.

I happen to think that this restriction imposed by Lisp
is a reasonable one, and that what you want to do is a
silly thing to want to do. Presumably you think it's a
silly restriction, and that what you want to do is reasonable.
Be all that as it may, you can't do it. Not only because you
can't change the name of a symbol, but also because you can't
change the attributes[1] of symbols in the COMMON-LISP package.

    [1] I'd say "properties", but that has a more specific
        meaning.

>> Check readtable-case
>> http://www.lispworks.com/reference/HyperSpec/Body/f_rdtabl.htm
> 
> It's not sufficient. See example below.
...
> (gen-java-code ()
>    (let ((modifiers '(public)))
>      `(class ,@modifiers Toto) ))

So. You want symbols to be read case-preservingly because
that fits whatever Java thing you're doing, but you want
to be able to use the ordinary symbols of CL in lowercase
because uppercase is so awful. Bad news: the language
doesn't permit that. You can complain about the language,
or you can find another mechanism for your Java names.
How about strings? Or you can use the perfectly adequate
mechanism Lisp already has for getting arbitrary characters
into symbol names: |Toto|.

You don't like uppercase letters and you don't like vertical
bars? Then you can't have what you want. Too bad. You also
can't make Java case-fold its input and have all its keywords
changed to upper-case. :-)

                           *

I've been a bit harsh here. Maybe you have a really good
reason for wanting to do what you say you want to do. But
you haven't given one yet; you've just said "I want this"
and "I want that". Tell us *why* vertical bars, or using
strings instead of symbols, or putting the reader in case-invert
mode and hacking your Lisp-to-Java interface code to invert
the case of symbols, isn't good enough.

-- 
Gareth McCaughan
.sig under construc
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <416f9555$0$29875$626a14ce@news.free.fr>
"Gareth McCaughan" <················@pobox.com> a �crit dans le message de
···················@g.mccaughan.ntlworld.com...
> Christophe Turle wrote:
>
> [Pascal Bourguignon:]
> > > The essence of a symbol is in its name
> > >, symbols must be distinct from
> > > other symbols. Symbol is one to its name.
>
> [Christophe:]
> > For you perhaps, but this is not the case of people like me who see
symbols
> > as concepts. Do you know about "le triangle s�miotique : r�f�rent,
signifi�,
> > signifiant".
> ...
> > - Concepts and names are not the same. One concept may even have
different
> > names. Else we were all speaking the same language (human ones).
> >
> > - The name is just a "pointer" to the symbol. A way to reference it.
>
> Indeed, concepts and names are not the same. But concepts and
> symbols are not the same either. Why do you expect symbols to
> behave more like concepts than like names?

I think it is because they were design with this in mind. The property-list
was there to keep concept properties. AI fields used a lot concepts this
way.

> >>> I want to rename all lisp symbols to their downcase counter
> >>> part. I found this way to correct the bad reader uppercase
> >>> convention : we write symbols in lower-case but as mentionned
> >>> here a few days ago, we still use upper-case conversion for
> >>> backward compatibility :(
>
> Well, you want something that Lisp offers no way to do.

i'm not yet sure ;-)

> You'd have the same problem if you were writing in C++
> and wanted a way to make it treat identifiers case-insensitively,
> or if you were writing in Fortran and wanted a way to make it
> dynamically typed.

We are using lisp, don't forget.

> Actually, a better analogy: it's as if
> you were writing in just about any language and wanted to
> replace all its keywords with Japanese translations -- and
> weren't prepared to accept solutions involving macro
> preprocessors, new namespaces, etc.

If i'm using lisp it's because it is self-extensible.

> I happen to think that this restriction imposed by Lisp
> is a reasonable one, and that what you want to do is a
> silly thing to want to do. Presumably you think it's a
> silly restriction, and that what you want to do is reasonable.
> Be all that as it may, you can't do it.

Give me some more time ;)

> Not only because you
> can't change the name of a symbol, but also because you can't
> change the attributes[1] of symbols in the COMMON-LISP package.
>
>     [1] I'd say "properties", but that has a more specific
>         meaning.
>
> >> Check readtable-case
> >> http://www.lispworks.com/reference/HyperSpec/Body/f_rdtabl.htm
> >
> > It's not sufficient. See example below.
> ...
> > (gen-java-code ()
> >    (let ((modifiers '(public)))
> >      `(class ,@modifiers Toto) ))
>
> So. You want symbols to be read case-preservingly because
> that fits whatever Java thing you're doing, but you want
> to be able to use the ordinary symbols of CL in lowercase
> because uppercase is so awful. Bad news: the language
> doesn't permit that. You can complain about the language,
> or you can find another mechanism for your Java names.
> How about strings? Or you can use the perfectly adequate
> mechanism Lisp already has for getting arbitrary characters
> into symbol names: |Toto|.

ugly !

> You don't like uppercase letters and you don't like vertical
> bars? Then you can't have what you want.

really not sure yet ;)

> Too bad. You also
> can't make Java case-fold its input and have all its keywords
> changed to upper-case. :-)
>
>                            *
>
> I've been a bit harsh here. Maybe you have a really good
> reason for wanting to do what you say you want to do. But
> you haven't given one yet; you've just said "I want this"
> and "I want that". Tell us *why* vertical bars, or using
> strings instead of symbols,

ugly.

> or putting the reader in case-invert
> mode and hacking your Lisp-to-Java interface code to invert
> the case of symbols, isn't good enough.

Good idea ! solving a bad by a bad but it seems to work. Thx for the idea i
will keep it and use it if i can't achieve my cl modern mode.


___________________________________________________________
Christophe Turle.
(format nil ···@~S.~S" 'c.turle 'wanadoo 'fr)

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: Paul Khuong
Subject: Re: changing a symbol name
Date: 
Message-ID: <a828a711.0410150707.6e5b6dc9@posting.google.com>
"Christophe Turle" <······@nospam.com> wrote in message news:<·························@news.free.fr>...
> "Gareth McCaughan" <················@pobox.com> a �crit dans le message de
> ···················@g.mccaughan.ntlworld.com...
[...]
> > or putting the reader in case-invert
> > mode and hacking your Lisp-to-Java interface code to invert
> > the case of symbols, isn't good enough.
> 
> Good idea ! solving a bad by a bad but it seems to work. Thx for the idea i
> will keep it and use it if i can't achieve my cl modern mode.
How is that bad? Your own idea would mean that things defined before
the synbol name substitution would work differently than those after.
Now, THAT is ugly: an implicit, modal change on something as
fundamental as the behavior of symbols. That is very nearly the
epitome of the misuse of global properties. For example:

(defun foo nil (bar)) ;s0

[change bar to baz] ;c

(defun bar nil blah) ;s1

(defun foo2 nil (bar)) ;s2
(defun foo3 nil (baz)) ;s3

What does changing the symbol of the symbol's data mean? s2 is now
different from s0! Is s3 the same as s0? Is BAR actually not BAR? Is
there a spoon? Not only is the very concept of changing a symbol's
name, its _key_, extremely confusing, but the consequences are far
from clear.

In addition, your way of doing things is even worse, since it makes
the meaning of _symbols_ dependant on time, on the order forms are
evaluated. Now that is ugly, not using a preprocessor, or a macro. At
least, when the madness is clearly scoped by a form, the time factor
is eliminated. Quarantining your special reading needs, rather than
radically affecting the whole environment is clearly much more elegant
and beautiful, and is actually usable and logical. Oh, and, when you
only want to change a function's name, using an editor is clearly the
way to go. You're going to do it anyway.

Paul Khuong
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <416ff18c$0$29882$626a14ce@news.free.fr>
"Paul Khuong" <·······@gmail.com> a �crit dans le message de
·································@posting.google.com...
> "Christophe Turle" <······@nospam.com> wrote in message
news:<·························@news.free.fr>...
> > "Gareth McCaughan" <················@pobox.com> a �crit dans le message
de
> > ···················@g.mccaughan.ntlworld.com...
> [...]
> > > or putting the reader in case-invert
> > > mode and hacking your Lisp-to-Java interface code to invert
> > > the case of symbols, isn't good enough.
> >
> > Good idea ! solving a bad by a bad but it seems to work. Thx for the
idea i
> > will keep it and use it if i can't achieve my cl modern mode.

> How is that bad?

The idea is good. what is bad is that we write 'foo' and it is change to
'FOO' internaly. It is a hack. Imagine lisp were designed nowdays, i think
cl symbols would be in lowercase. This means, we are not making evolve the
lisp design, we are just hacking it.

> Your own idea would mean that things defined before
> the synbol name substitution would work differently than those after.

Yes.

> Now, THAT is ugly: an implicit, modal change on something as
> fundamental as the behavior of symbols. That is very nearly the
> epitome of the misuse of global properties. For example:
>
> (defun foo nil (bar)) ;s0
>
> [change bar to baz] ;c
>
> (defun bar nil blah) ;s1
>
> (defun foo2 nil (bar)) ;s2
> (defun foo3 nil (baz)) ;s3
>
> What does changing the symbol of the symbol's data mean? s2 is now
> different from s0!

Yes it is.

> Is s3 the same as s0?

Yes.

> Is BAR actually not BAR? Is
> there a spoon? Not only is the very concept of changing a symbol's
> name, its _key_, extremely confusing, but the consequences are far
> from clear.


> In addition, your way of doing things is even worse, since it makes
> the meaning of _symbols_ dependant on time, on the order forms are
> evaluated.

Yes. And i agree that it may be confusing. But not allowing it won't tell us
its usefulness.

> Now that is ugly, not using a preprocessor, or a macro. At
> least, when the madness is clearly scoped by a form, the time factor
> is eliminated. Quarantining your special reading needs, rather than
> radically affecting the whole environment is clearly much more elegant
> and beautiful, and is actually usable and logical.

> Oh, and, when you
> only want to change a function's name, using an editor is clearly the
> way to go. You're going to do it anyway.

One problem is that your old definition is still there.

___________________________________________________________
Christophe Turle.
(format nil ···@~S.~S" 'c.turle 'wanadoo 'fr)

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: Vassil Nikolov
Subject: Re: changing a symbol name
Date: 
Message-ID: <lz8ya421bt.fsf@janus.vassil.nikolov.names>
"Christophe Turle" <······@nospam.com> writes:

> [...]
> Imagine lisp were designed nowdays, i think
> cl symbols would be in lowercase.

  Would it then have (by default) a case-insensitive but downcasing
  reader, or a case-sensitive one?

  ---Vassil.


-- 
Vassil Nikolov <········@poboxes.com>

Hollerith's Law of Docstrings: Everything can be summarized in 72 bytes.
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <41736dea$0$29860$626a14ce@news.free.fr>
"Vassil Nikolov" <········@poboxes.com> a �crit dans le message de
···················@janus.vassil.nikolov.names...
> "Christophe Turle" <······@nospam.com> writes:
>
> > [...]
> > Imagine lisp were designed nowdays, i think
> > cl symbols would be in lowercase.
>
>   Would it then have (by default) a case-insensitive but downcasing
>   reader, or a case-sensitive one?

case-sensitive.

-- 

___________________________________________________________
Christophe Turle.
(format nil ···@~S.~S" 'c.turle 'wanadoo 'fr)

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
XP hack for Clisp : http://perso.wanadoo.fr/turle/lisp/xp.html
From: Vassil Nikolov
Subject: Re: changing a symbol name
Date: 
Message-ID: <lz8ya370nf.fsf@janus.vassil.nikolov.names>
"Christophe Turle" <······@nospam.com> writes:

> "Vassil Nikolov" <········@poboxes.com> a �crit dans le message de
> ···················@janus.vassil.nikolov.names...
>> "Christophe Turle" <······@nospam.com> writes:
>>
>> > [...]
>> > Imagine lisp were designed nowdays, i think
>> > cl symbols would be in lowercase.
>>
>>   Would it then have (by default) a case-insensitive but downcasing
>>   reader, or a case-sensitive one?
>
> case-sensitive.

  I much prefer case-insensitive names by default [1] (of course, it
  is important to have the option of case-sensitive names, but only if
  explicitly requested).  I believe it is important to be "culturally
  compatible" with (certain) natural languages, when it comes to the
  question whether two names are different, if they only differ in
  their letter case.  (Yes, I know that there are many who believe
  otherwise.)  For example, I feel much more comfortable to know that

    (defun foo (...) ...)
    (defun Foo (...) ...)
    (defun FOO (...) ...)

  won't define three different functions.  Another example, from Java,
  a case-sensitive language, is the way a couple of names such as
  javax.servlet.http.HttpServletResponse.encodeUrl were deprecated
  (the latter in favor of encodeURL) just because the authors didn't
  get the case right the first time.  (And is it really consistent to
  have "Http" but "URL" in various names?)

  ---Vassil.

  [1] Needless to say, I'm quite used to case-sensitive ones as well...

-- 
Vassil Nikolov <········@poboxes.com>

Hollerith's Law of Docstrings: Everything can be summarized in 72 bytes.
From: jayessay
Subject: Re: changing a symbol name
Date: 
Message-ID: <m3brey1zug.fsf@rigel.goldenthreadtech.com>
Vassil Nikolov <········@poboxes.com> writes:

>   I much prefer case-insensitive names by default [1] (of course, it
>   is important to have the option of case-sensitive names, but only if
>   explicitly requested).

I agree, general default case sensitivity is just plain nasty.  What I
think would cover most needs and desires is to have
case-insensitive+case-preserving as the default.


/Jon

-- 
'j' - a n t h o n y at romeo/charley/november com
From: Marco Antoniotti
Subject: Re: changing a symbol name
Date: 
Message-ID: <DXQcd.14$u5.30026@typhoon.nyu.edu>
Vassil Nikolov wrote:
> "Christophe Turle" <······@nospam.com> writes:
> 
> 
>>[...]
>>Imagine lisp were designed nowdays, i think
>>cl symbols would be in lowercase.
> 
> 
>   Would it then have (by default) a case-insensitive but downcasing
>   reader, or a case-sensitive one?

I'd bet it would have a case sensitive reader.

Cheers
--
Marco
From: Mario S. Mommer
Subject: Re: changing a symbol name
Date: 
Message-ID: <fz3c0gfg59.fsf@germany.igpm.rwth-aachen.de>
"Christophe Turle" <······@nospam.com> writes:
> [...deleted...]

Yeah, Mr. Turle, but what happens is that Common Lisp users are a
bunch of backward boneheads trapped in a backyard of computer science,
with an appalling sense of taste, and clearly not up to the task to
understand how revolutionary, no, how *brilliant*, your concept of
semiotic, java compatible, renameble, case insensitive symbol is.

Thank you for being so gracious to inform us.
From: Kenny Tilton
Subject: Re: changing a symbol name
Date: 
Message-ID: <vrRbd.30407$4C.5181672@twister.nyc.rr.com>
Mario S. Mommer wrote:

> "Christophe Turle" <······@nospam.com> writes:
> 
>>[...deleted...]
> 
> 
> Yeah, Mr. Turle, but what happens is that Common Lisp users are a
> bunch of backward boneheads ....

I was wondering how long it would take the ilias detectors to start 
going off. and I believe the preferred term is "savages".

:)

kt

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: Pascal Bourguignon
Subject: Re: changing a symbol name
Date: 
Message-ID: <87655dnec1.fsf@thalassa.informatimago.com>
"Christophe Turle" <······@nospam.com> writes:
> For you perhaps, but this is not the case of people like me who see symbols
> as concepts. Do you know about "le triangle s�miotique : r�f�rent, signifi�,
> signifiant".
> 
> simpler and in english ;)
> 
> - Concepts and names are not the same. One concept may even have different
> names. Else we were all speaking the same language (human ones).
> 
> - The name is just a "pointer" to the symbol. A way to reference it.
> 
> - you can change a name by an other and your program will still behave the
> same way. If you change a concept from an other, it won't work the same way.

For me, and for the lisp system. The problem is that the lisp system
considers that the _name_ of a symbol _identifies_ the symbol.  Of
course, its "address" too (but not the physical address, since it can
change due to copying colletors).  Why is it important?  Because as
has been said the relationship between the names and the symbol is not
kept only in the symbol-name slots, but also in hash-tables, in symbol
tables, and more importantly, virtually in *compiled* code.  That's
why I'm keeping telling you to do it at the _source_ level, with an
editor.  

This does not necessarilly means out of the lisp system: you can use
hemlock, or you could have a sexp editor inside your lisp image.  With
my clisp example, I underlined the fact that most lisp system don't
keep the source of the functions (some don't even keep the
documentation strings!).   So you won't be able to track all
references to a given symbol, be it by name or by pointer, because you
may not have access to the compiled functions or to other data
structures generated and used by the lisp system, disassemble
notwithstanding.

For parts of programs on which the lisp system does not apply any
special meaning(don't generate code and data structures from a
source), you _could_ use symbols in the way you want. For example,
with uninterned symbols, or with symbols interned in a package of your
own not used in program source (as "identifier"), it would not matter
if you renamed them because the lisp system would not have hash-tabled
them or otherwise compiled them.  Personnally, I would rather use CLOS
objects for in that case.

> > 1- use an EDITOR!!!
> 
> I want to solve this pb with lisp not with externals tools. And i don't see
> how an editor can help me there.
> 
> > 2- see SUBST, for example:
> >
> >         (subst 'good-name 'bad-name '(defun fun (bad-name other-name)
> >                                           (+ bad-name other-name)))
> >
> >         ==> (DEFUN FUN (GOOD-NAME OTHER-NAME) (+ GOOD-NAME OTHER-NAME))
> 
> here an example :
> 
> (gen-java-code ()
>    (let ((modifiers '(public)))
>      `(class ,@modifiers Toto) ))
> 
> How do you use your subst ? class and public can be subst since they belong
> to a pre-defined set but 'Toto' ?
 
The important point in my example is the use of quote in front of
(defun fun... : it's considered as data, ie. as a source form.
Later you could:

    (eval (subst 'good-name 'bad-name '(defun fun (bad-name other-name)
                                             (+ bad-name other-name))))

to have the lisp system take into account the substitution.

I don't see any difference between class and Toto.

(subst 'foobar toto '(gen-java-code ()
                        (let ((modifiers '(public)))
                             `(class ,@modifiers Toto) )))



> > What guarantee do you have that if you substitute in the
> > function-lambda-expression, the change will be applied to the function
> > closure?
> 
> Did i say that ? i just proposed :
> 
> 1- to change the name of symbols
> 2- to wrap cl variables/functions/macros/special forms with downcase
> symbols.

We must be asking/answering  different threads then...

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Voting Democrat or Republican is like choosing a cabin in the Titanic.
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <416f8ff2$0$29889$626a14ce@news.free.fr>
"Pascal Bourguignon" <····@mouse-potato.com> a �crit dans le message de
···················@thalassa.informatimago.com...
> > > 1- use an EDITOR!!!
> >
> > I want to solve this pb with lisp not with externals tools. And i don't
see
> > how an editor can help me there.
> >
> > > 2- see SUBST, for example:
> > >
> > >         (subst 'good-name 'bad-name '(defun fun (bad-name other-name)
> > >                                           (+ bad-name other-name)))
> > >
> > >         ==> (DEFUN FUN (GOOD-NAME OTHER-NAME) (+ GOOD-NAME
OTHER-NAME))
> >
> > here an example :
> >
> > (gen-java-code ()
> >    (let ((modifiers '(public)))
> >      `(class ,@modifiers Toto) ))
> >
> > How do you use your subst ? class and public can be subst since they
belong
> > to a pre-defined set but 'Toto' ?
>
> The important point in my example is the use of quote in front of
> (defun fun... : it's considered as data, ie. as a source form.
> Later you could:
>
>     (eval (subst 'good-name 'bad-name '(defun fun (bad-name other-name)
>                                              (+ bad-name other-name))))
>
> to have the lisp system take into account the substitution.
>
> I don't see any difference between class and Toto.
>
> (subst 'foobar toto '(gen-java-code ()
>                         (let ((modifiers '(public)))
>                              `(class ,@modifiers Toto) )))
>
>
>

let's abstract your code :

(defun substitution (code)
  (subst 'foobar 'toto code) ) ; (subst 'class '|class| ...) is ok.

(setq *code* '(gen-java-code ()
                (let ((modifiers '(public)))
                 `(class ,@modifiers Toto) )))

;; if i've made no errors, it should do the same thing.
(substitution *code*)

What i was saying is that the 'substitution' function should be defined only
once for all possible codes. It's why i pointed that it could be done for
java keywords, since i know all of them, but it can't be done for app
specific names like 'toto', else you have to change your body for each app.

___________________________________________________________
Christophe Turle.
(format nil ···@~S.~S" 'c.turle 'wanadoo 'fr)

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html