[plt-scheme] Should DrScheme assume Module language when #lang?

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Tue May 26 17:22:11 EDT 2009

Jos Koot wrote at 05/26/2009 03:41 PM:
>>
>> 1. The "#lang" needs to be at the very start of the file, not after a 
>> comment.  Which makes sense.
>
> My experience is different. I often have lots of comments at the top 
> of a module without any problems DrScheme opening with language 'module'.

I just verified that this behavior of automatically changing to "Module" 
on opening a file with "#lang" seems to work only if "#lang" is the 
first line, in 4.1.5 on Linux.  Here is the procedure to reproduce:

1. Create a file named "hello.ss" consisting of the 3 lines:

;; This is a comment on the first line.
#lang scheme
(display "hello\n")

2. Start a new DrScheme.

3. Change the DrScheme language to "R5RS", and hit Run.

4. Open in DrScheme the file "hello.ss".

5. Observe that the DrScheme language was not changed to "Module", and 
that the "#lang" line is not the first line.

6. Quit DrScheme.

7. Delete the first line of "hello.ss", so that now the "#lang" line is 
the first line.

8. Start DrScheme.

9. Observe that the DrScheme language is "R5RS".

10. Open in DrScheme the file "hello.ss", which now has "#lang" as the 
first line.

11. Observe that the DrScheme language has changed to "Module".

-- 
http://www.neilvandyke.org/


Posted on the users mailing list.