[racket-dev] [racket] pretty-big->#lang (was: External connection toFinndesign Liitin)

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Aug 11 09:20:56 EDT 2011

On Thu, Aug 11, 2011 at 8:17 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
> [switch to dev]
> On Thu, Aug 11, 2011 at 12:11 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>> DrRacket's interactions window has to use `eval' in the sense that it
>> reads an expression to evaluate and then passes it on to the program
>> for an answer. When you run a module in DrRacket, the interactions
>> window treats expressions as being in the language of the module body.
>> Furthermore, since the interactions window works through `eval', it
>> turns out that DrRacket sets `eval' globally to use the module's
>> language while evaluating expressions in the interactions window. In
>> Racket terminology, DrRacket sets the `current-namespace' parameter to
>> the module's namespace when it initializes the interactions window.
> I think this paragraph (the rest is great!)

The rest is really excellent, I agree. (I even liked this part :)

>  points to the key problem.
>  The fact that insufficiently-namespaced uses of `eval' work in the
> interactions window leads people to the wrong conclusion about how
> things work in general.  Also, whereas everything else has a good
> reason given, this behavior is described with "it turns out that" and
> an explanation about the implementation.
> How problematic would it be if the DrRacket interactions window didn't
> make the namespace it uses for evaluation available to the expressions
> being evaluated?

How would that work? Could drracket compile the expression in the
namespace that has the insides of the module and then, when evaluating
it, set the namespace back to the one in effect while running the
definitions window? (That seems a bit strange; I don't have a good
idea how it would work.)


Posted on the dev mailing list.