> On Sep 3, 2016, at 5:54 PM, David Storrs <david.sto...@gmail.com> wrote: > > Hi John, > > > On Sat, Sep 3, 2016 at 5:25 PM, John Clements <cleme...@brinckerhoff.org> > wrote: > > > On Sep 3, 2016, at 4:43 PM, David Storrs <david.sto...@gmail.com> wrote: > > > > I typically use Emacs, but I thought I would experiment with DrRacket a > > bit. I'm on OSX 10.11 using DrRacket v6.6, freshly installed an hour ago. > > I started it up, File>New, typed this: > > > > > > #lang racket > > (displayln "hello world") > > > > > > and hit the Run button at top right. I get the following message at bottom: > > > > Welcome to DrRacket, version 6.6 [3m]. > > Language: R5RS [custom]; memory limit: 128 MB. > > . #%module-begin: illegal use (not a module body) in: (#%module-begin > > (displayln "hello world”)) > > Looks like DrRacket is set to the “R5RS” language. You probably want to set > the language level to “Use language declared in source”. > > Ah, you're exactly right. I went to Language>Choose Language and chose 'The > Racket Language' and now it works. Thanks. > > I’m guessing you set it to R5RS yourself? > > Nope. I used it exactly as it came out of the box. > > > Thinking about how to avoid this: Would it make sense to hack something in > that catches this and related errors and gives a helpful suggestion if the > file begins with #lang? > > John > > That would be helpful, yes. The best would probably be if DrRacket's > out-of-the-box language setting was something like "Use whatever is specified > in the file; if nothing is specified then default to <whatever>”
For the last ’n’ years, the out-of-the-box setting has been “you must choose a language level before continuing,” though it’s possible that in 6.6, the default is “the Racket language.” My guess—and keep in mind my guesses are usually wrong—is that you set your language level preference months or years ago, and that it was just lurking in a preference file. John > > Dave > > > > > > > I tried saving the file (File>Save Definitions) as "foo.rkt" and running it > > again with (unsurprisingly) no change. > > > > It runs fine from the command line using "racket foo.rkt" 'which racket' > > shows that I am in fact using the v6.6 version. (I have v5.3.1, v6.3 and > > v6.6 installed) > > > > I've googled around and found something similar from 2013 but there was no > > closure on that thread. I threw "illegal use (not a module body)" at the > > search box in the Racket docs and got nothing back. I've skimmed through > > the documentation on modules and I don't see what would be relevant there. > > > > I'm sure this is something simple but I have no idea where to look. Any > > suggestions? > > > > Dave > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Racket Users" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to racket-users+unsubscr...@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: PGP signature