<div dir="ltr">Nevermind. I was making things way too complicated. Obviously I can just return #'(pattern) in the event I'd like the caller's procedure invoked.<div><br></div><div style>Thanks.</div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Apr 17, 2013 at 11:29 AM, Scott Klarenbach <span dir="ltr"><<a href="mailto:scott@pointyhat.ca" target="_blank">scott@pointyhat.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi there,<div><br></div><div>With my limited macro knowledge I'm trying to accomplish the following:</div><div><br></div><div>Create a macro that accepts custom dsl-ish syntax. In addition to the custom syntax, a user can also provide a procedure.</div>
<div><br></div><div>For example: </div><div><br></div><div>(my-macro [(name:first-name type:string required:#t)</div><div> (name:last-name type:string)</div><div> (hash 'id middle-name 'type 'string)</div>
<div> (lambda () (do-something-arbitrary))])</div><div><br></div><div>The first two are the dsl, the next two are procedures. The macro converts the shorthand key:val syntax into hashes internally and does some other processing. So far, so good. </div>
<div><br></div><div>But additionally I'd like to invoke any provided procedure (any datum that doesn't match the dsl syntax) in lieu of the short-hand syntax.</div><div><br></div><div>What's the "correct" way to invoke the procedures, since I'm sure I'm doing it wrong.</div>
<div><br></div><div>So far, I'm converting each syntax expression that's not in the dsl using syntax-datum. But then they're quoted, and I have to use eval, which imposes a bunch of namespace complexity. Is there a way to invoke syntax without eval? Or is there a much better way entirely to write the macro so that the above would work?</div>
<div><br></div><div>Thanks.</div><div> <br clear="all"><div><br></div>-- <br>Talk to you soon,<br><br>Scott Klarenbach<br><br>PointyHat Software Corp.<br><a href="http://www.pointyhat.ca" target="_blank">www.pointyhat.ca</a><br>
p <a href="tel:604-568-4280" value="+16045684280" target="_blank">604-568-4280</a><br>e <a href="mailto:scott@pointyhat.ca" target="_blank">scott@pointyhat.ca</a><br><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">200-1575 W. Georgia</span><br>
Vancouver, BC <span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">V6G2V3</span><br><br>_______________________________________<br>To iterate is human; to recur, divine
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Talk to you soon,<br><br>Scott Klarenbach<br><br>PointyHat Software Corp.<br><a href="http://www.pointyhat.ca" target="_blank">www.pointyhat.ca</a><br>p 604-568-4280<br>
e <a href="mailto:scott@pointyhat.ca" target="_blank">scott@pointyhat.ca</a><br><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">200-1575 W. Georgia</span><br>
Vancouver, BC <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">V6G2V3</span><br><br>_______________________________________<br>To iterate is human; to recur, divine
</div></div></div>