<div dir="ltr">I've been planning to write an extense document about syntax-rules, since there is a variety of techniques that aren't documented anywhere except in the mailing lists or usenet groups. Actually, you can even write unhygienic macros using syntax-rules, but that's a whole different story (and the paper describing the technique is 15 pages showing you how to break the system).<div>

<br></div><div style>I'll try to write that document as soon as possible!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 11, 2013 at 5:25 PM, Mikael <span dir="ltr"><<a href="mailto:mikael.rcv@gmail.com" target="_blank">mikael.rcv@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div>2013/1/5 Meng Zhang <span dir="ltr"><<a href="mailto:wsxiaoys.lh@gmail.com" target="_blank">wsxiaoys.lh@gmail.com</a>></span></div>

<div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




<div dir="ltr"><div class="im"><div class="gmail_extra">While talking about the syntactic-closures, If we ignore syntax-case, I'll disagree that it brings "incredible" complexity. I've been uncertain</div>

</div><div class="gmail_extra">




on syntactic-closures for years [..] I found</div><div class="im"><div class="gmail_extra">the concept of it is quite straight forward. </div></div></div></blockquote><div> </div></div><div class="gmail_quote"><div class="im">

2013/1/6 Álvaro Castro-Castilla <span dir="ltr"><<a href="mailto:alvaro.castro.castilla@gmail.com" target="_blank">alvaro.castro.castilla@gmail.com</a>></span><br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I agree with Meng.<div>I see syntax-rules as a DSL for hygienic macros. It is completely "schemey" in the same way libraries like Kanren for logic programming, or FrTime for reactive programming are. The only difference is that when using hygienic macros, your code becomes data as well, to be processed before it actually turns into code.</div>






</div></blockquote><div><br></div></div><div><div>Meng and Alvaro, ah, note taken, to have a clearer take on them personally, I'd need some serious experience of using them, and until now I did not really dig into them that much personally.</div>






<div><br></div><div><br></div><div>It's really unfortunate, in a sense, that in a hybrid S.C. and define-macro environment, that any use in define-macro of symbol? or any kind of symbol inspection or comparison, easly becomes *Completely Messed*.</div>




<div><br></div><div>Here's a mild example:</div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><div><div><font face="courier new, monospace">(define-macro (debug-print . a)</font></div>




</div></div></div><div class="gmail_quote"><div><div><div><font face="courier new, monospace">   (for-each (lambda (e) (cond ((symbol? e) (print "'" (symbol->string e) " "))</font></div><div><font face="courier new, monospace">                               ((string? e) (print e " "))</font></div>




<div><font face="courier new, monospace">                               (else (write e) (print " ")))) a))</font></div></div></div></div><div class="gmail_quote"><div><div><font face="courier new, monospace"><br>




</font></div></div></div><div class="gmail_quote"><div><div><font face="courier new, monospace">(debug-print 5 + 7 "\n")</font></div></div></div></blockquote><div class="gmail_quote"><div><div><br></div><div>What is printed in the place of "+" depends on the particular grace of the SC macros loaded and the expander in this moment and instance.</div>




<div><br></div><div>It could |write| any expander-internal structure really, with any amount of object dependencies.</div><div><br></div><div>Now this was a really basic example, if some more extensive one comes to your mind feel free to share.</div>




</div><div><br></div><div><br></div><div><div>Meng:</div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">





<div dir="ltr"><div class="gmail_extra">Though I deadly missed an easy-to-understand, concrete implementation with document for it during the learning process.</div></div></blockquote><div><br></div></div><div>Yes! Like, a complete reference of Scheme macro systems: How to use them, strengths and limitations, how to implement them on their own and in hybrid forms, and what the challenges are, including illustrative examples.</div>






</div><div><br></div><div>This would do well as a downloadable PDF book.</div><div><br></div><div> </div><div>Alvaro:</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div dir="ltr">

<div>Actually, when you take into account a couple of pitfalls regarding lexical scoping and shadowing and use a variety of techniques, including continuation-passing-style, writing syntax-rules macros are extremely powerful and similar to regular recursive scheme.</div>






</div></blockquote><div><br></div></div><div>Can you give any code examples of use of this variety of techniques for writing extremely powerful syntax-rules macros?</div><div><br></div><br><div class="gmail_quote"><div class="im">

2013/1/8 Hendrik Boom <span dir="ltr"><<a href="mailto:hendrik@topoi.pooq.com" target="_blank">hendrik@topoi.pooq.com</a>></span><br>




<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Mon, Jan 07, 2013 at 10:37:08AM -0500, Jason Felice wrote:<br>






...<br>...<br><div>> I don't think efficiency in terms of constant factors should often win<br>> versus code which could be more general.   Clearly this is a value choice;<br>> however, I wonder how well a compiler can eliminate type dispatching<br>






> without adding type annotation to the language.<br><br></div>For me, the value of type anotations is the possibility of static type<br>checking, which catches bugs fast.  That the compiler can then use the<br>information to generate better code is a pleasant freebie.<br>






<br>It would be interesting to see if the stragegy in, say, typed Racket,<br>could be usefully adapted to Gambit.<br></blockquote><div><br></div></div><div>Yes, type annotations that catch bugs already at expand time would be of value.</div>




<div><br></div><div>The abstract interpreter might not catch all at compile time of course, but, really enough. I'd be curious to know what kind of performance such a solution would have .. I wonder what Might published recently.</div>




<div><br></div>

<div><br></div></div></div>
</blockquote></div><br></div>