[racket] #lang/module equivalence

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Tue Aug 3 11:17:41 EDT 2010

This looks like one of those odd #%module-begin bugs that comes up
when you have a module with exactly one form inside it.  I believe
that these days,

#lang s-exp module-path
form ...

is actually equivalent to

(module name module-path
  (#%module-begin form ...))

The distinction is only meaningful when "form ..." is a sequence with
exactly one element.  Either add the #%module-begin or add one more
form to the file and it should behave the same.  (I have not tried
this, however, and could be wrong.)

Carl Eastlund

On Tue, Aug 3, 2010 at 11:12 AM, Shriram Krishnamurthi <sk at cs.brown.edu> wrote:
> According to the docs,
>
>      #lang s-exp module-path
>      form ...
>
>    is equivalent to
>
>      (module name module-path
>        form ...)
>
> Yet:
>
>  #lang s-exp lang/htdp-advanced
>
>  (check-expect 1 2)
>
> runs without error (though there is no error signaled either), whereas
>
>  Welcome to DrRacket, version 5.0 [3m].
>  Language: racket; memory limit: 128 MB.
>  > (module M lang/htdp-advanced (check-expect 1 2))
>  . check-expect: found a test that is not at the top level in:
> (check-expect 1 2)
>
> What am I missing?
>
> Shriram


Posted on the users mailing list.