On Tue, Oct 29, 2013 at 04:36:30AM -0700, Casey Rodarmor wrote:
> On Tue, Oct 29, 2013 at 4:20 AM, Peter Bex <[email protected]> wrote:
> > Of course, another classic trick is to put a quote in front of the
> > expansion code and print the result.  This will work fine from the
> > interpreter as well:
> >
> > (define-syntax foo
> >   (syntax-rules ()
> >    ((foo) '(+ 1 1))))
> >
> > (print (foo))
> > ;; Or, to see the expression in context:
> > (print `(* ,(foo) 10))
> >
> 
> Forgive my ignorance, but wouldn't that prevent recursive macro expansion?

That's correct; it'll work for one level only.  But for quick debugging
that's often just enough.  Depending on the type of macro and the place
where you want to be debugging you can insert the quote in various
different places, or expand to something that prints some subexpressions.
But I agree, it's not very scalable.

Cheers,
Peter
-- 
http://www.more-magic.net

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to