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

Q&A's, tips, howto's
Locked
hartrock
Posts: 136
Joined: Wed Aug 07, 2013 9:37 pm

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

Post by hartrock »

Tried after User Manual and Reference v.10.6.4:

Code: Select all

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
>
Last edited by hartrock on Thu Aug 13, 2015 9:50 am, edited 1 time in total.

ralph.ronnquist
Posts: 228
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: [bug][10.6.4] expansion macro rewrite does not work

Post by ralph.ronnquist »

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

hartrock
Posts: 136
Joined: Wed Aug 07, 2013 9:37 pm

Re: [bug][10.6.4] expansion macro rewrite does not work

Post by hartrock »

But it works with:

Code: Select all

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: [bug][10.6.4] expansion macro rewrite fails -> workaroun

Post by 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.

Locked