[racket-dev] open untagged files in blank language level?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Oct 7 11:59:33 EDT 2011

On Fri, Oct 7, 2011 at 9:06 AM, Eli Barzilay <eli at barzilay.org> wrote:
> Three hours ago, Robby Findler wrote:
>> On Thu, Oct 6, 2011 at 10:37 PM, Stephen Bloch <bloch at adelphi.edu> wrote:
>> >
>> > How about this: when you open an existing file that has no
>> > prologue or #lang, it opens in "text mode": the Check Syntax and
>> > Run buttons are both disabled.
>>
>> Another possibility: it could open in the 'not a language' language
>> that you get if this is the first time you've started drracket (if
>> it has been a while since you've seen this mode, you can move your
>> preferences out of the way and restart drracket to see it again).
>
> If you do either of this -- one way to avoid a worse interface for
> people who are used to open some random file and then run it is to
> detect when a `#lang' was inserted at the top and switch to the "use
> language declared in source" langugae when that happens.
>
> This could actually be done for student languages also, with a minor
> change of popping up some dialog saying "are you sure that you know
> what you're doing?".

I agree that it makes the most sense to always be detecting "what is
at the front of the buffer" and to make decisions based on that,
instead of doing something like "someone just opened a new file; make
some decisions".

But I'm not really satisfied with any of the alternatives (including
the current implemented one), so I'll keep thinking for now.

Robby


Posted on the dev mailing list.