[racket] Defining a typed language

From: Konrad Hinsen (konrad.hinsen at fastmail.net)
Date: Wed Oct 29 05:50:35 EDT 2014

Sam Tobin-Hochstadt writes:

 > > This suggests that if I want my single-form module to be handled exactly
 > > like a multi-form module, my single form must expand to something else
 > > than #%plain-module-begin. Fine. But who or what decides what my single
 > > form becomes when it is "partially expanded in a module-begin context" ?
 > This always happens in a single-form module. The macro system
 > partially-expands the macro to see if it turns into a version of
 > #%module-begin.

Fine, but how? Where are the rules that lead to

  (displayln (foo 42))

being partially expanded to 

  (#%plain-module-begin ...)

Are they part of the language definition? More specifically, I am
looking for a way to override them.


Posted on the users mailing list.