<div dir="ltr">Oh, nice! I didn't realize that, thanks.<div><br></div><div>After playing around with it, I realized it doesn't do everything I would like it to do, however. For a couple of the macros that I provide in my #lang language, I would like to provide some syntax rules such that Check Syntax throws an error when a program breaks those rules. Is this possible?</div>
<div><br></div><div>For instance, say I have a macro in my language which provides a new form, but a form that is only intended to be used with other macros and functions provided by my language. That is to say, I would like to raise a syntax error if the programmer tries to use procedures/macros not defined in my language module <i>inside</i> a use of my macro, like this:</div>
<div><br></div><div><font face="courier new, monospace">(restricted-begin ; A form of begin whose body I would like to restrict to expressions in my language.</font></div><div><font face="courier new, monospace"> (one-of-my-features '(1 2 3))</font></div>
<div><font face="courier new, monospace"> (car '(1 2 3))) ; <-- since I do not define car in my language module, disallow its use.</font> </div><div><br></div><div>Basically, I have some special forms whose bodies I would like to restrict to containing only features of my language, and not of standard Racket, in effect preventing the intermingling of my language features and those of Racket.</div>
<div><br></div><div>I just realized that if this is at all possible, I would run into an issue on the first line of that macro's body, where I use quote. Is it also possible, given the possibility of the above, for me to allow certain Racket features while restricting others, instead of just placing a blanket syntax rejection of all things Racket?</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 11:39 AM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On May 29, 2014, at 11:49 PM, Daniel Brady <<a href="mailto:dabrady@umail.iu.edu">dabrady@umail.iu.edu</a>> wrote:<br>
<br>
> Hi everyone,<br>
><br>
> I just finished creating a small #lang language, and now I would like to start creating some static debugging tools for it. The first thing on my list is a basic syntax checker. I consulted the DrRacket documentation on creating tools and plugins, but honestly it went a bit over my head: this is my first foray into extending anything, and I don't really know where to start.<br>
><br>
> So my question(s) boils down to this: how can I provide syntax checking for my little #lang language? My little language really just provides some new syntactic forms, and is built directly on top of Racket, so there's nothing fancy I need to do with this: I just need to provide some new rules to the built-in syntax checker so that it also recognizes my extensions. How can I do this?<br>
<br>
<br>
</div></div>If that's all there is, DrRacket provides Check Syntax automatically for your language. Part of the goal of the project is to specialize the IDE to new languages automatically. (No we're not there yet in general.)<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Matthias<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><i><font face="garamond, serif">SEE YOU SPACE COWBOY...</font></i></div>
</div>