Subject: bug in for on pre59 built with clisp using cygwin
From: Yasuaki Honda
Date: Fri, 21 Dec 2001 01:37:52 +0900
Dear Richard Fateman,
Oops, I am not trying to say that he should change his maxima code
from "for u in x do ..." to "for u IN x do ...". I just posted my
observation
so that others may find the reason of the bug and fixes.
I am trying to track down this bug. What I have learned after the last
post is that if you do (C1) as follows, the "for u in ..." can be
repaired.
(C1) :lisp (setf (get '|$in| 'UPCASE) '$IN)
(C2) for u in [1,2,3] do print(u);
1
2
3
(C3)
I have looked into commac.lisp and found that the funcation
bothcase-implode
needs (setf (get '|$in| 'UPCASE) '$IN) to work properly for keywords
such as
for, in, and do in this case.
I am still trying to figure out where this (setf (get ... 'upcase) ...)
is performed
for symbols such as 'for' and 'do'. (maybe putprop is used instead of
setf and
get). I need some more time to understand this part of the source code.
Is there any document of the internal structure of maxima?
Yasuaki Honda
Japan.
On 2001.12.21, at 00:43, Richard Fateman wrote:
> Violating the suggestion that "if it ain't broke don't fix it"
>
> I suggest nevertheless that the maxima code be changed
> to all lower case (except for comments, character strings,
> and other deliberate capitalizations). This makes it
> compatible with Allegro common lisp's both-cases, built-in
> names in lower case, "modern" mode. It should not break
> anything in the other common lisps. It makes the code
> easier for humans to read and (in the case below), easier
> to write!
> RJF
>
>
> Yasuaki Honda wrote:
>
>> Dear Dr. Dan Stanger,
>> I just noticed that:
>> for u IN x do print(u);
>> works fine while
>> for u in x do print(u);
>> does not.
>> Capitalizing both letters looks important. Certainly this should be
>> a bug...
>> Yasuaki Honda
>> Japan
>> On 2001.12.20, at 10:22, Dan Stanger wrote:
>>> f(x):=for u in x do print(u); give the following error message:
>>> Incorrect syntax: in is an unknown keyword in a DO statement.
>>>
>>> This works correctly in previous versions.
>>> Dan Stanger
>>>
>>> _______________________________________________
>>> Maxima mailing list
>>> Maxima@www.math.utexas.edu
>>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima@www.math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>