Re: [racket] `provide` failed under `#lang racket/load`

2013-08-04 Thread Yi Dai
On Sun, Aug 4, 2013 at 10:40 AM, Carl Eastlund wrote: > On Sun, Aug 4, 2013 at 4:32 AM, Yi Dai wrote: > >> >> >> >> On Sun, Aug 4, 2013 at 10:20 AM, Carl Eastlund wrote: >> >>> Yi, >>> >>> Most #lang languages implicitly create a module from the contents of the >>> file. #lang racket/load, on

Re: [racket] `provide` failed under `#lang racket/load`

2013-08-04 Thread Carl Eastlund
On Sun, Aug 4, 2013 at 4:32 AM, Yi Dai wrote: > > > > On Sun, Aug 4, 2013 at 10:20 AM, Carl Eastlund wrote: > >> Yi, >> >> Most #lang languages implicitly create a module from the contents of the >> file. #lang racket/load, on the other hand, runs the contents of the file >> as top-level terms

Re: [racket] `provide` failed under `#lang racket/load`

2013-08-04 Thread Yi Dai
On Sun, Aug 4, 2013 at 10:20 AM, Carl Eastlund wrote: > Yi, > > Most #lang languages implicitly create a module from the contents of the > file. #lang racket/load, on the other hand, runs the contents of the file > as top-level terms outside of any module. The provide form is not legal at > the

Re: [racket] `provide` failed under `#lang racket/load`

2013-08-04 Thread Carl Eastlund
Yi, Most #lang languages implicitly create a module from the contents of the file. #lang racket/load, on the other hand, runs the contents of the file as top-level terms outside of any module. The provide form is not legal at the top level, as it is meaningless -- there's no module to provide th

[racket] `provide` failed under `#lang racket/load`

2013-08-04 Thread Yi Dai
Hi, I have the following code in a file named `foo.rkt`: ``` #lang racket/load (provide foo) (define foo 'bar) ``` When trying to run the code, I got the following confusing error: > `provide`: not at module level in: `(provide foo)` What does this mean? Why `provide` is not at module leve