[bug][10.6.4] expansion macro rewrite fails -> workaround

Started by hartrock, August 12, 2015, 06:47:29 PM

Previous topic - Next topic

hartrock

Tried after User Manual and Reference v.10.6.4:
sr@free:~/newLISP$ newlisp
newLISP v.10.6.4 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

> (macro (double X) (+ X X))
(lambda-macro (X) (expand '(+ X X)))
> (define double (lambda-macro (X) (expand '(add X X))))

ERR: symbol is protected in function define : double
>

rrq

#1
Good catch. And it happens on 10.6.[23] as well.

hartrock

#2
But it works with:
sr@free:~/newLISP$ newlisp
newLISP v.10.6.4 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

> (macro (double X) (+ X X))
(lambda-macro (X) (expand '(+ X X)))
>  (constant 'double (lambda-macro (X) (expand '(add X X))))
(lambda-macro (X) (expand '(add X X)))
> double
(lambda-macro (X) (expand '(add X X)))
>

So this seems to be a minor issue.



PS: Is this the best place for such reports? Is it OK, to delete this post after a fix?

Lutz

In v10.6.4 the manual entry has been changed to constant.



Note, that changes to an expansion macro definition only affect future loaded code, not already read and expanded code.



Ps: don't delete bug posts.