Re: Expansion of a macro

2015-04-21 Thread A0
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

Re: Expansion of a macro

2015-04-20 Thread tomas
-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---

Re: Expansion of a macro

2015-04-20 Thread Panicz Maciej Godek
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

Re: Expansion of a macro

2015-04-20 Thread Mark H Weaver
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

Re: Expansion of a macro

2015-04-20 Thread tomas
-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

Expansion of a macro

2015-04-20 Thread A0
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?