<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 style> (name:last-name type:string)</div><div style> (hash 'id middle-name 'type 'string)</div>
<div style> (lambda () (do-something-arbitrary))])</div><div style><br></div><div style>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 style><br></div><div style>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 style><br></div><div style>What's the "correct" way to invoke the procedures, since I'm sure I'm doing it wrong.</div>
<div style><br></div><div style>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 style><br></div><div style>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 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>