Last development version of newLisp is really pretty (I should try and work on the vim mode, I will during the holidays) and have some nifty features, sp. regarding lexical scope with contexts...
So I want to write a protected macro, let's say a silly one that doesn't work:
Code: Select all
(define-macro (do-but:do-but condition body)
(if (= (eval condition) true)
true
(begin
(eval body)
(do-but condition body))))
Tested with:
Code: Select all
(set 'x 1)
(do-but (= x 10) (begin (+ x 1) (print x)))
[code>
1
call stack overflow : if
[/code]
Now, I launch the debugger and the editor but I find this:
Code: Select all
(define-macro (do-but:do-but MAIN:condition MAIN:body)
(if (= (eval MAIN:condition) true)
true
(begin
(eval MAIN:body)
(do-but MAIN:condition MAIN:body))))
Now, I suspect I should throw a labdba or two on that to make it work, but my question(s) is(/are): is the editor showing a bug? did I read badly that the macro arguments would be in its context when defining it this way? How do I see the value of something inside the debugger (specially when I'm debugging a macro)?
Lastly, though I want to fight this myself, a helping hand will be appreciated :-)
thanks,<br>david
<i>PS: there's a Common Lisp tutorial on the web that's making a simple interactive rpg game. I wanted to translate it to newlisp as a means of practising and if the original author allows as a tutorial on newlisp for others... He proposes calling macros SPEL: Semantic Program Enhancing Logic... his reasons are probably sound, and nevertheless he makes a kind of macro alias, I am trying to get his defspel done in newlisp if its possible, and I don't see why not... URL: http://www.lisperati.com/spels.html Thx!</i>