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

Q&A's, tips, howto's

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

Postby hartrock » Thu Aug 13, 2015 1:47 am

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.
hartrock
 
Posts: 136
Joined: Wed Aug 07, 2013 9:37 pm

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

Postby ralph.ronnquist » Thu Aug 13, 2015 2:57 am

Good catch. And it happens on 10.6.[23] as well.
ralph.ronnquist
 
Posts: 208
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

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

Postby hartrock » Thu Aug 13, 2015 9:32 am

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?
hartrock
 
Posts: 136
Joined: Wed Aug 07, 2013 9:37 pm

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

Postby Lutz » Thu Aug 13, 2015 1:31 pm

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


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 2 guests