On 21/04/15 07:22, to...@tuxteam.de wrote:
> On Mon, Apr 20, 2015 at 09:32:48PM -0400, Mark H Weaver wrote:
>> A0 writes:
>>> How can one find out what a macro expands to?
>
>> You can use the ,expand REPL command, e.g.:
>
> Not the OP, but... thanks for this one!
>
> -- t
>
I second!
Thank
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Mon, Apr 20, 2015 at 09:32:48PM -0400, Mark H Weaver wrote:
> A0 writes:
> > How can one find out what a macro expands to?
>
> You can use the ,expand REPL command, e.g.:
Not the OP, but... thanks for this one!
- -- t
-BEGIN PGP SIGNATURE---
Or you can (use-modules (system base compile) (srfi srfi-11))
and then
(define* (expand-form e #:key (opts '()))
(let-values (((exp env) (decompile
(compile e #:from 'scheme
#:to 'tree-il
#:env (c
A0 writes:
> How can one find out what a macro expands to?
You can use the ,expand REPL command, e.g.:
scheme@(guile-user)> ,expand (do ((n 10 (- n 1))) ((zero? n) n))
$1 = (let loop ((n 10))
(if (zero? n)
(begin (if #f #f) n)
(loop (- n 1
Mark
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Mon, Apr 20, 2015 at 04:33:07PM +0100, A0 wrote:
> Hi all,
>
> How can one find out what a macro expands to?
> Error reports are useful when it expands to nonsense, but how
> to do this in general?
There's macroexpand, but perhaps it'll expand mor
Hi all,
How can one find out what a macro expands to?
Error reports are useful when it expands to nonsense, but how
to do this in general?