<div dir="ltr">Does defmacro do what you want?<div><br></div><div><a href="http://docs.racket-lang.org/compatibility/defmacro.html?q=defmacro#%28form._%28%28lib._compatibility%2Fdefmacro..rkt%29._defmacro%29%29">http://docs.racket-lang.org/compatibility/defmacro.html?q=defmacro#%28form._%28%28lib._compatibility%2Fdefmacro..rkt%29._defmacro%29%29</a><br>
</div><div><br></div><div>In terms of grokking the macro system you probably want to read some of the research papers, which you can find from links here:</div><div><br></div><div><a href="http://racket-lang.org/people.html">http://racket-lang.org/people.html</a><br>
</div><div><br></div><div>Racket's macro system is really cutting edge, so it doesn't have a large body of text explaining it.</div><div><br></div><div>HTH,</div><div>N.</div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Aug 4, 2013 at 9:50 PM, Nick Sivo <span dir="ltr"><<a href="mailto:nicksivo@gmail.com" target="_blank">nicksivo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everyone,<br>
<br>
I work on Hacker News[1], which is written in Arc[2], and am tasked<br>
with making it faster. The Arc compiler targets Racket[3], but<br>
doesn't do so in such a way that function names or source locations<br>
are preserved. This makes output from the sampling profiler and error<br>
messages mostly useless.<br>
<br>
I'd like to make Arc work as a Racket language (and in the process<br>
preserve srclocs and names), and have made some progress[4]. However,<br>
I'm hitting a wall trying to implement Arc's macros. Specifically, I<br>
need to find a way for the macros themselves to use previously defined<br>
Arc functions as part of their processing. I understand that there are<br>
good reasons for Racket's hygiene and syntax phases, but I'm<br>
implementing an existing language that has its own strong opinions.<br>
I'm almost certain that accomplishing my goal is possible with the<br>
right understanding, but despite reading much of the Racket Reference,<br>
I don't truly get it yet.<br>
<br>
With that motivation in mind, what's the best way for me to become<br>
intimately familiar with Racket's runtime, execution and compilation<br>
model? Should I read through and make sure I understand the debugger?<br>
The macro stepper? Is there any kind of guide to Racket Internals?<br>
<br>
Thanks for any advice.<br>
<br>
Best,<br>
Nick<br>
<br>
[1] <a href="https://news.ycombinator.com" target="_blank">https://news.ycombinator.com</a><br>
[2] <a href="http://arclanguage.org" target="_blank">http://arclanguage.org</a><br>
[3] Well, really mzscheme<br>
[4] <a href="https://github.com/kogir/rark" target="_blank">https://github.com/kogir/rark</a><br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br></div>