[plt-scheme] on-execute method in drscheme:language:language<%>

From: Guillaume Marceau (gmarceau at cs.brown.edu)
Date: Fri Jun 16 14:33:29 EDT 2006

On Fri, 16 Jun 2006 11:49:00 -0400
Eli Barzilay <eli at barzilay.org> wrote:

> Wouldn't that be better to do at syntax-expansion time?  Something
> like overriding #%module-begin for module code, and the evaluation
> handler for other toplevel interactions?  (And that will make it
> possible to use outside of DrScheme.)

This is exactly the approach that I take in my type checker (called
Dungeon).  Dale, I can send you some example code if you want.

Matthias' objections was that you might want to run the code without
trying to check it first. To do that, there are three versions of the
Dungeon language: the first one just runs, the second just type checks,
the third type checks then run.  All three languages are otherwise
equivalent.  You can quickly switch between behaviors by changing the
language specification at the beginning of the module.



You might still want to write a DrScheme extension, if you don't mind
about type checking in MzScheme. In this case, the hook you want is
front-end/complete-program in drscheme:language:language<%>


-- 
Pataphor:

   1. An extended metaphor that creates its own context.
   2. That which occurs when a lizard's tail has grown so long 
      it breaks off and grows a new lizard.


Posted on the users mailing list.