On 17 Sep 2009, at 3:42 pm, John Cowan wrote: > I keep being told that let-syntax allows you to write: > > (let ((x ...) ...) > (let-syntax y (....x.....)) > > allowing the body of the macro y to access the bound variable x, but I > have yet (after repeated challenges) to be shown a non-toy example of > this construction.
It's not something I've had to use myself, but something I've always felt would come in useful one day. Perhaps some sort of complex construct with lots of internal structure would be best implemented by having the outer form expand into a let-syntax that defines the syntax for the internal structural components, so they're not polluting the namespace outside of the context they make sense in? Also, I am a MAD NESTED ENCAPSULATION FAN, so often find myself stacking internal defines somewhat deeply (yeah, yeah, I should get into using modules, and then just define everything at the top level and just export the things I mean to, I know...), and I'm sure one day I'll want to remove some local duplication by defining a local macro... ABS -- Alaric Snell-Pym Work: http://www.snell-systems.co.uk/ Play: http://www.snell-pym.org.uk/alaric/ Blog: http://www.snell-pym.org.uk/archives/author/alaric/ _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
