[racket-dev] implicit begin for define-syntax-rule

From: Marijn (hkBst at gentoo.org)
Date: Mon May 7 10:38:31 EDT 2012

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04-05-12 21:54, Vincent St-Amour wrote:
> I don't think that's what Marijn was suggesting.
> 
> I understood it as:
> 
> (define-syntax-rule (define-complex real-name imag-name rhs) 
> (define real-name (real-part rhs)) (define imag-name (imag-part
> rhs)))
> 
> (define-complex r i 1+2i)
> 
> =>
> 
> (begin (define r (real-part 1+2i)) (define i (imag-part 1+2i)))
> 
> 
> Marijn, is this what you meant?

Yes, that is indeed what I meant.

I wanted to benefit from being able to use multiple forms as in
lambda, but on second thought I guess this would conflict with `begin'
having a different meaning in macro templates than it does in function
bodies... I should prolly also rethink whether I didn't mean `(let ()
...)' in my code...

Thanks,

Marijn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+n3mcACgkQp/VmCx0OL2xZWQCfWUkdcMHLxbo6DsnT/KnRyUBw
MLcAn0cqH1ptiC7E5XBE43C5lJKba0+x
=FfQt
-----END PGP SIGNATURE-----

Posted on the dev mailing list.