From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <416edb2d$0$560$626a14ce@news.free.fr>
"Jon Boone" <········@delamancha.org> a �crit dans le message de
···················@spiritus.delamancha.org...
> "Christophe Turle" <······@nospam.com> writes:
>
> > Yes, i'm currently trying to wrap all exported symbols from CL in their
> > downcase counterpart.
>
> Just use the following settings for readtable-case and *print-case*:

not sufficient.

> readtable-case  :PRESERVE

When you can do that it's already too late for cl symbols. They are already
in uppercase. So you will have to write them in uppercase and it's what i
want to avoid.

> *print-case*    :DOWNCASE
>
> You get this input/output:
>
>   ZEBRA        ZEBRA
>   Zebra        Zebra
>   zebra        zebra
>
>   --jon




-- 

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

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

From: Jon Boone
Subject: Re: changing a symbol name
Date: 
Message-ID: <m3fz4h5944.fsf@spiritus.delamancha.org>
"Christophe Turle" <······@nospam.com> writes:

> When you can do that it's already too late for cl symbols. They are already
> in uppercase. So you will have to write them in uppercase and it's what i
> want to avoid.

  Ah, then you want the allegro "modern" environment.

--jon
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <416eee2f$0$558$626a14ce@news.free.fr>
"Jon Boone" <········@delamancha.org> a �crit dans le message de
···················@spiritus.delamancha.org...
> "Christophe Turle" <······@nospam.com> writes:
>
> > When you can do that it's already too late for cl symbols. They are
already
> > in uppercase. So you will have to write them in uppercase and it's what
i
> > want to avoid.
>
>   Ah, then you want the allegro "modern" environment.
>
> --jon

It seems.

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

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: Antonio Menezes Leitao
Subject: Re: changing a symbol name
Date: 
Message-ID: <873c0hhrkr.fsf@evaluator.pt>
"Christophe Turle" <······@nospam.com> writes:

> "Jon Boone" <········@delamancha.org> a �crit dans le message de
> ···················@spiritus.delamancha.org...
>> "Christophe Turle" <······@nospam.com> writes:
>>
>> > When you can do that it's already too late for cl symbols. They are
> already
>> > in uppercase. So you will have to write them in uppercase and it's what
> i
>> > want to avoid.
>>
>>   Ah, then you want the allegro "modern" environment.
>>
>> --jon
>
> It seems.

No, it doesn't.

Read the hyperspec section on readtable-case :invert and also the
section on the effects of the readtable-case on printing.

Ant�nio Leit�o.
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <416f908e$0$29871$626a14ce@news.free.fr>
"Antonio Menezes Leitao" <··············@evaluator.pt> a �crit dans le
message de ···················@evaluator.pt...
> "Christophe Turle" <······@nospam.com> writes:
>
> > "Jon Boone" <········@delamancha.org> a �crit dans le message de
> > ···················@spiritus.delamancha.org...
> >> "Christophe Turle" <······@nospam.com> writes:
> >>
> >> > When you can do that it's already too late for cl symbols. They are
> > already
> >> > in uppercase. So you will have to write them in uppercase and it's
what
> > i
> >> > want to avoid.
> >>
> >>   Ah, then you want the allegro "modern" environment.
> >>
> >> --jon
> >
> > It seems.
>
> No, it doesn't.
>
> Read the hyperspec section on readtable-case :invert and also the
> section on the effects of the readtable-case on printing.
>


I have read the "modern mode" from allegro site and it seems to be exactly
what i want. I have not seen they use :invert...

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

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: Marco Antoniotti
Subject: Re: changing a symbol name
Date: 
Message-ID: <nBTbd.13$u5.24378@typhoon.nyu.edu>
Christophe Turle wrote:
> 
> 
> I have read the "modern mode" from allegro site and it seems to be exactly
> what i want. I have not seen they use :invert...
> 

They don't.  Instead they break the ANSI standard.

Seriously.  Have you considered creating your own ad hoc CL-LOWERCASE 
package? (Pardon the pun :) )

Then you can program in it with READTABLE-CASE set to :PRESERVE.

Cheers
--
Marco
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <4170e538$0$25710$636a15ce@news.free.fr>
"Marco Antoniotti" <·······@cs.nyu.edu> a �crit dans le message de
······················@typhoon.nyu.edu...
>
> Seriously.  Have you considered creating your own ad hoc CL-LOWERCASE
> package? (Pardon the pun :) )
>
> Then you can program in it with READTABLE-CASE set to :PRESERVE.

Yes.

As shown in previous posts two ways to accomplish this :

- hacking the reader to wrap the mapping string->symbols.
- redirecting CL-LOWERCASE symbols to their CL counterparts.

But since :invert mode seems to suffice for my problem at hand and is
portable, i keep these for future needs.

-- 

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

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: Brian Downing
Subject: Re: changing a symbol name
Date: 
Message-ID: <D0Sbd.132302$He1.12711@attbi_s01>
In article <·························@news.free.fr>,
Christophe Turle <······@nospam.com> wrote:
> Damned, it seems you are full right !
> 
> > (setf (readtable-case *readtable*) :invert)
> 
> > `(java-keyword ,(cons  'javaName 'JAVACST))
> (java-keyword (javaName . JAVACST))
> 
> 
> And just when my hack was working !!!

Now keep in mind that the symbol-names for:

(java-keyword (javaName . JAVACST))

are actually

("JAVA-KEYWORD" ("javaName" . "javacst"))

In your Java glue you're going to have to re-invert all names that are
either all upper case or all lower case.

Still, this is a far better solution that trying to make a new
common-lisp package with lowercase symbols.  Many people tried to
mention :invert in this discussion - I'm glad you decided it would work
for you.

Your hack probably won't work in general for many reasons.  For one
example, make-hash-table :test will only accept CL:EQUALP, not your new
cl:equalp.  Indeed, I bet this is why Allegro only supports selecting
between ANSI mode and Modern mode by redumping the image - it's such an
incredibly pervasive change.

-bcd
-- 
*** Brian Downing <bdowning at lavos dot net> 
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <416ff6b3$0$29876$626a14ce@news.free.fr>
"Brian Downing" <·············@lavos.net> a �crit dans le message de
···························@attbi_s01...
> In article <·························@news.free.fr>,
> Christophe Turle <······@nospam.com> wrote:
> > Damned, it seems you are full right !
> >
> > > (setf (readtable-case *readtable*) :invert)
> >
> > > `(java-keyword ,(cons  'javaName 'JAVACST))
> > (java-keyword (javaName . JAVACST))
> >
> >
> > And just when my hack was working !!!
>
> Now keep in mind that the symbol-names for:
>
> (java-keyword (javaName . JAVACST))
>
> are actually
>
> ("JAVA-KEYWORD" ("javaName" . "javacst"))
>
> In your Java glue you're going to have to re-invert all names that are
> either all upper case or all lower case.

I hope no ! I won't use the symbol-name, i will let the printer do the work
for me from the symbols.

> Still, this is a far better solution that trying to make a new
> common-lisp package with lowercase symbols.  Many people tried to
> mention :invert in this discussion - I'm glad you decided it would work
> for you.

What makes me change my mind was the "java glue". I was thinking it was
required (so bye bye orthogonality). I had not seen the printing was
considering the :invert.

> Your hack probably won't work in general for many reasons.  For one
> example, make-hash-table :test will only accept CL:EQUALP, not your new
> cl:equalp.

If you read/test my hack you will see that cl:equalp is never seen. the new
read function convert it to CL:EQUALP as wanted by the :test.


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

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: Brian Downing
Subject: Re: changing a symbol name
Date: 
Message-ID: <M3Wbd.264228$3l3.23627@attbi_s03>
In article <·························@news.free.fr>,
Christophe Turle <······@nospam.com> wrote:
> > Your hack probably won't work in general for many reasons.  For one
> > example, make-hash-table :test will only accept CL:EQUALP, not your new
> > cl:equalp.
> 
> If you read/test my hack you will see that cl:equalp is never seen. the new
> read function convert it to CL:EQUALP as wanted by the :test.

Ah, my apologies.  But from your hack:

(setf (symbol-function 'read)
      (lambda (&rest args)
        (let ((x (cl:apply *read-fct* args)))
	  (if (wrapper-p x)
	      (wrapped-symb x)
	      x))))

You were correct in your comment - this is not allowed in conforming
Common Lisp.  In SBCL this yields:

------------------------------------------------------------------------
Lock on package COMMON-LISP violated when setting the symbol-function of READ.
   [Condition of type SYMBOL-PACKAGE-LOCKED-ERROR]

See also:
  SBCL Manual, Package Locks [node]
  Common Lisp Hyperspec, 11.1.2.1.2 [section]
------------------------------------------------------------------------

Looking at the CLHS in section 11.1.2.1.2 gives a laundry list of 19
things you are not allowed to do to an external symbol of the
COMMON-LISP package.  Number 1 disallows binding or altering its value.

However, it is a rather ingenious (yet disgusting!) hack.  :)

-bcd
-- 
*** Brian Downing <bdowning at lavos dot net> 
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <4170df70$0$25698$636a15ce@news.free.fr>
> You were correct in your comment - this is not allowed in conforming
> Common Lisp.  In SBCL this yields:
>
> ------------------------------------------------------------------------
> Lock on package COMMON-LISP violated when setting the symbol-function of
READ.
>    [Condition of type SYMBOL-PACKAGE-LOCKED-ERROR]
>
> See also:
>   SBCL Manual, Package Locks [node]
>   Common Lisp Hyperspec, 11.1.2.1.2 [section]
> ------------------------------------------------------------------------
>
> Looking at the CLHS in section 11.1.2.1.2 gives a laundry list of 19
> things you are not allowed

'undefined'

> to do to an external symbol of the
> COMMON-LISP package.  Number 1 disallows binding or altering its value.

Good reference, thx sbcl.

I think it's more :
- 2. Defining, undefining, or binding it as a function.

Now i understand why read is not traceable with clisp :
- 9. Tracing it (via trace).

So these implementations are right but what a pitty all these restrictions.
I hope it will fall one day after all 'undefined' is not 'not allowed' and
corman lisp is a proof it can be done.

Thx for the clarification.

___________________________________________________________
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: <lz4qks217n.fsf@janus.vassil.nikolov.names>
"Christophe Turle" <······@nospam.com> writes:

>> [...]
>> Looking at the CLHS in section 11.1.2.1.2 gives a laundry list of 19
>> things you are not allowed
>
> 'undefined'

  That still means "not allowed", but without a guarantee that every
  attempt at breaking the rules will be caught.

  ---Vassil.

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

Hollerith's Law of Docstrings: Everything can be summarized in 72 bytes.