What is returned from infix:
> (INFIX:xlate "3 + 4")
(add 3 4)
> (eval(INFIX:xlate "3 + 4"))
value expected in function add : 3
> (integer?(nth 1 (INFIX:xlate "3 + 4")))
nil
> (float?(nth 1 (INFIX:xlate "3 + 4")))
nil
> (string?(nth 1 (INFIX:xlate "3 + 4")))
nil
What this?
More strange:
> (symbol?(nth 1 (INFIX:xlate "3 + 4")))
true
Sequential rollback until 8.200:
There it was working:
> (INFIX:xlate "3 + 4")
(add 3 4)
> (eval(INFIX:xlate "3 + 4"))
7
>
Seems context related.
Ps: infix.lsp from 8.2 and 8.4.7 are identical.
After 8.2 newLISP is able to make a symbol out of number and that changes the logic in the function 'make-expresion'. Make the following change:
;; in make-expresion change
(if (not (or (set 'var (symbol vars))
(set 'var (float vars)) ))
;; to this
(if (not (or (set 'var (float vars))
(set 'var (symbol vars)) ))
Lutz
ps: I uploaded a fixed version also to http://newlisp.org/index.cgi?page=Downloads
Lutz,
thanks for the quick fix!
I need the infix-parser much for my project.