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

From: John Clements (clements at brinckerhoff.org)
Date: Thu Oct 6 16:35:35 EDT 2011

On Oct 6, 2011, at 11:30 AM, Robby Findler wrote:

> Two hours ago, John Clements wrote:
>>> Currently, opening a file that doesn't begin with a #lang line
>>> results in a window whose language level is inherited from the
>>> buffer that was foremost when the open-file was issued (IIUC).
> 
> No, it defaults to whatever language you last chose in the language
> level (or in the popup at the bottom of the drracket window), unless
> it sees a #lang line at the beginning, in which case it uses the 'use
> the language declared in the source' language (but that does not count
> as changing that last choice).
> 
>> I think this is a mistake. I think that instead, the language
>> level should revert to "Use the language defined in the source."
> 
> I don't want to default to 'use language in source' because of
> students that have chose one of the teaching languages. They should
> keep getting that student language over and over and not having to
> explicitly keep re-choosing it. Unless I misunderstand the proposal
> somehow?

Yes, I believe you misunderstand my proposal. In particular, I believe we agree that opening a new file or tab should create a file that's "in the current language level." If there's any disagreement, it's about what should happen when an existing file--specifically, one that doesn't begin with #lang--is opened. Unless I'm missing something, this means that the only time students will have to "re-select" the language level is when they download a file that's intended to be evaluated in a student language, but that doesn't have a #lang line in it. Right?

In my particular case, I had a program for students that reads in a rhythm from a text file.  The problem was that when students opened this text file in a drracket editor and changed it a bit and saved it, all of a sudden their rhythms came out as incredibly bizarre, because of the hidden first lines of the text file.

>> If anything, just the name of the "use the language defined in the
>> source" language is a very long one, which is unfortunate since it's
>> often the one that gets recommended often.
> 
> Easy to agree here. :)

Yes, I totally agree with this.  This name will disappear when language levels disappear, right?

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20111006/489bc158/attachment.p7s>

Posted on the dev mailing list.