[racket] #lang

From: Eli Barzilay (eli at barzilay.org)
Date: Sat May 14 22:28:51 EDT 2011

25 minutes ago, Stephen Bloch wrote:
> On May 14, 2011, at 8:07 PM, Shriram Krishnamurthi wrote:
> > #lang annoyed me until I "got it"; now it annoys me immensely that I
> > have to use a *menu* to select a (teaching) language.
> Oh, I agree entirely: the choice of language belongs in the source
> code, not in a per-user preferences file.  I'd rather have my
> students' files start with
> #lang bsl
> or 
> #lang isll
> or something, as long as my students don't need to SEE that.


> Could we have a menu option in DrRacket to hide or show the #lang
> line (perhaps in a separate pane)?


As Shriram said, this is similar to how the language choice is encoded
in current teaching language files, and it leads to bad surprises --
weird errors if you do add a `#lang' in the part that you do see,
surprises when you edit the file outside of DrRacket, and confusions
when you copy-paste the code and send it to someone else.

> For the benefit of beginning students, I'd like to keep the language
> selection menu, but its effect would be to alter the (hidden) #lang
> line.

IME, the language dialog is currently a major source of confusion.  It
tempts people to choose languages that they shouldn't choose (I see
*many* people that go with "pretty big"), it makes the better choice
unclear (I can't even properly tell people how to choose it without
firing up drr just to see the long "Use the language declared in the
source" name), and the name itself is very obscure for something that
should just be the default.  (It's still better than "Module" though.)

I'd be happy to see it go away, or if it would display a big warning
when changing the language.  (I know that it's impractical for legacy
reasons, and for new students.)

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.