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

From: John Clements (clements at brinckerhoff.org)
Date: Thu Oct 6 12:23:48 EDT 2011

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). I think this is a mistake. I think that instead, the language level should revert to "Use the language defined in the source."

My first argument for this is a bit silly and technical; this behavior is inconsistent with the other behavior of the "save" toolbar button show/hide, which appears to be that the button is shown when the text that DrR would save is different from the last-saved version. This means that changing language levels shows the "save" button, and therefore (I claim) so should opening a file without #lang info in a non-use-defined-in-source language level.

However, I think an even better fix is just to open such files in the use-lang-defined-in-source language level.

Upside of this change: people who edit, say, .html or .txt files in DrRacket won't get an ugly surprise when they save them. This is more insidious in the case of files such as .html which are intended to be interpreted by a different tool (in this case a web browser), which will barf on the inserted #lang line.

Downside of this change: people who *create student-language files outside of DrR* will then have to set the language level when opening those files. This seems uncommon to me.


-------------- 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/5bf3fad9/attachment.p7s>

Posted on the dev mailing list.