Re: Bug#182116: ILISP broken with readtable inverted

"Adam Warner" <[email protected]>
Newsgroups gmane.lisp.ilisp.devel
Message-ID <[email protected]>
Hi Bob Rogers,

>    From: "Adam Warner" <[email protected]>
>    Date: Sun, 23 Feb 2003 20:08:09 +1300
> 
>    Hi Kevin,
> 
>    > Adam Warner submitted the following bug. I don't know what would be
>    > required to fix it.
> 
>    Thanks Kevin. I'm stumped. The ILISP code appears to use the correct case.
>    The only place that seems to mention common-lisp-user is
>    /usr/share/emacs21/site-lisp/ilisp/ilisp-cl.el where it's quoted as 
>    :common-lisp-user. 
> 
> Yes, that's from the patch Will Deakin put in last fall to find a
> default package in case-sensitive dialects.
> 
>    But this of course is Emacs code. Could there be some
>    evil Emacs Lisp/ANSI Common Lisp interaction going on here?
> 
>    Regards,
>    Adam
> 
> I'm not familiar with all of this case-mangling stuff, since I don't use
> it myself, but it seems to me that the returned package name,
> "COMMON-LISP-USER", is correct.  The problem seems to be that
> ilisp::ilisp-symbol-name (in the Lisp), drops the ball, as it doesn't
> know about :invert case.  The immediate fix should be straightforward,
> but I'm afraid I don't have any time to spare right now . . .
> 
>    But the ilisp code is full of places that assume more conventional
> case modes.  For example, some places use (string-match "^nil$" result)
> to work around this, but many do not.  So I'm sure this is only the tip
> of the caseberg, as it were.

One caseberg at a time is fine with me :-) Thank you very much for the
analysis. I chucked in an invert-string script but finally discovered the
fix is to do nothing to the symbol-name just like preserve:

# diff -U 2 /tmp/cl-ilisp.lisp cl-ilisp.lisp 
--- /tmp/cl-ilisp.lisp  2003-02-24 11:38:40.000000000 +1300
+++ cl-ilisp.lisp       2003-02-24 11:37:12.000000000 +1300
@@ -244,5 +244,6 @@
     (:downcase (string-downcase symbol-name))
     (:capitalize (string-capitalize symbol-name))
-    (:preserve symbol-name)))
+    (:preserve symbol-name)
+    (:invert symbol-name)))
 

Mixed case functions evaluate fine and the differences are preserved:
(defun test () "test")
(defun Test () "Test")
(defun TEST () "TEST")

M-x cmulisp:
* ;;; Evaluating defun test
test
* ;;; Evaluating defun Test
Test
* ;;; Evaluating defun TEST
TEST
* (test)
"test"
* (Test)
"Test"
* (TEST)
"TEST"

M-x clisp-hs:
[8]> ;;; Evaluating defun test
test
[13]> ;;; Evaluating defun Test
Test
[15]> ;;; Evaluating defun TEST
TEST
[17]> (test)
"test"
[19]> (Test)
"Test"
[20]> (TEST)
"TEST"

It should be safe to commit this fix. Thanks again.

Regards,
Adam



-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.