- status: open --> closed
This is a problem with case insensitivity when creating
operators. I'll add the relevant email contents to
date - I'm afraid I don't know enough to provide useful
examples for all the cases this problem appears.
Bug affects:
$prefix, $postfix, $infix, $nary, $matchfix, and $nofix
Original example:
Maxima 5.9.1.1cvs http://maxima.sourceforge.net
Using Lisp SBCL 0.8.20
Distributed under the GNU Public License. See the file
COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function
bug_report()
provides bug reporting information.
(%i1) postfix("F");
(%o1) "f"
(%i2) postfix("f");
(%o2) "f"
(%i3) (x)f:=x*a;
(%o3) x f := x a
(%i4) 40f;
(%o4) 40 a
(%i5) 40F;
Incorrect syntax: f is not an infix operator
(%i5)
Ramond Toy responded (in part):
if it should distinguish case, the problem is probably
here:
(defmfun $postfix (operator &optional (lbp 180.)
(lpos '$any)
(pos '$any))
(upcase operator) ;; <-----
(def-operator operator pos lbp lpos () () t ()
'(led . parse-postfix) 'msize-postfix
'dimension-postfix () ))
where UPCASE intentionally upcases the operator. This
also affects
$prefix, $infix, $nary, $matchfix, and $nofix.
Ray
He followed up with:
I've played around a bit, and by just removing the
calls to upcase
(or making upcase do nothing), the case sensitivity is
gone. So CY's
example now looks like this:
(%i1) postfix("F");
(%o1) "F"
(%i2) postfix("f");
(%o2) "f"
(%i3) (x)f:=x*a;
(%o3) x F := x a
(%i4) 40f;
(%o4) 40 a
(%i5) 40F;
(%o5) 40 a
%o5 looks wrong to me. Shouldn't it be something like
"40 F"?
If so, there's something else that needs fixing.
And subsequently, when %o3 was identified as not
looking correct as well:
Oops. I must have had some leftovers because when I
did a recompile
instead of playing with the repl, I get:
(%i1) postfix("F");
(%o1) "F"
(%i2) postfix("f");
(%o2) "f"
(%i3) (x)f:=x*a;
(%o3) x f := x a
(%i4) 40f;
(%o4) 40 a
(%i5) 40F;
(%o5) 40 F
This seems more reasonable. I can't comment on Andreas
Guelzow's
issue with %o3, but at least %o5 seems to be right.
So just deleting all calls to (upcase operator) takes
care of this
issue and all tests pass.
Ray
So preliminary finding is (at least in postfix case,
upcase operator needs to be removed. Possible other
cases can use similar fix?
Logged In: YES
user_id=28849
Fixed. Also see bug 797401.
Logged In: YES
user_id=28849
Fixed. Also see bug 797401.
Log in to post a comment.