Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
A few minutes ago, Robby Findler wrote: > I'm not sure I'm quite getting this. Is the idea that, if there is a > #lang line present, DrRacket would always use that language. If there > is no #lang line present, then DrRacket would use some other language, > based on what was recently chosen in the language dialog? I think that this is what Nick suggested in this thread, and Neil is suggesting something more elaborate. Something along these lines sounds like a good idea to me. There's enough random pieces of code around that students might try and get this very bad error message. Maybe a milder version that instead of changing the language (which can be confusing for the same students) pops up some dialog with a nice message, and suggeting to switch the language to the "use the language declared in the source". It can have an "ok" button to switch the language for you, and with an "always do this" checkbox you get the above functionality when requested. (And that would be very convenient for many people who teach & hack, making switches easier.) BTW₁, sounds like Neil is suggesting something similar when there is no #lang too, going back to some language that you choose (or guess). BTW₂, how about renaming the "use the language declared in the source" or "Determine language from source" language as the "#lang" language? IMO it would look better as a header in the language dialog and on the status bar language indicator. The long name is a description, not a name, so it fits better the explanation part in the dialog. > On Wed, Mar 21, 2012 at 10:47 AM, Neil Van Dyke wrote: > > How about a change to the purpose of the Languages control? > > > > Currently, I think of the control *selecting how to determine* which > > language to use. Example settings "whatever #lang says", "Beginning > > Student", etc. > > > > The control could be changed to *present the determination* (by #lang or by > > some default), and only secondarily as a means to *change the determination* > > (which might mean automatically changing the #lang in the file). The list > > of override alternatives would be something like the languages that this > > DrRacket instance knows about. There would not be a "whatever #lang says" > > alternative, since that behavior is always the case. > > > > For determining the language when no #lang is present (such as when opening > > a file without a #lang, or when creating a new file), the default could be a > > preference setting, with alternatives like "Guess", "beginning-student", > > "advanced-student", "racket", "racket/base"... and whatever other languages > > this DrRacket knows. Default alternative would be "Guess", which I suspect > > will work fine for most people. > > > > The "Guess" alternative in this preference could be some heuristics like > > Emacs and the "file" command use (later on we could make these heuristics > > extensible by packages that implement languages), and default to the last > > #lang used. I suspect last-#lang-used would be fine, and any heuristics are > > a bonus. (The heuristics might determine language of the file as distinct > > from #lang languages, and for each file language, keep track of a > > last-#lang-used. So, a heuristic might recognize Scheme as the file's > > language, and then Guess would go and find what #lang the user last used for > > a Scheme file. Again, last-#lang-used, with no heuristics, is fine 95%+ of > > the time; heuristics are mostly for delighting the user with DrRacket's > > cleverness the other 5% of the time.) > > > > Robby's suggestion of *always* requiring #lang is tempting, and I am close > > to that, except that it would be nice to support languages that don't > > syntactically permit #lang. For example, if we wanted to load up > > JavaScript, XML, HTML, or Java files in DrRacket. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
I'm not sure I'm quite getting this. Is the idea that, if there is a #lang line present, DrRacket would always use that language. If there is no #lang line present, then DrRacket would use some other language, based on what was recently chosen in the language dialog? Robby On Wed, Mar 21, 2012 at 10:47 AM, Neil Van Dyke wrote: > How about a change to the purpose of the Languages control? > > Currently, I think of the control *selecting how to determine* which > language to use. Example settings "whatever #lang says", "Beginning > Student", etc. > > The control could be changed to *present the determination* (by #lang or by > some default), and only secondarily as a means to *change the determination* > (which might mean automatically changing the #lang in the file). The list > of override alternatives would be something like the languages that this > DrRacket instance knows about. There would not be a "whatever #lang says" > alternative, since that behavior is always the case. > > For determining the language when no #lang is present (such as when opening > a file without a #lang, or when creating a new file), the default could be a > preference setting, with alternatives like "Guess", "beginning-student", > "advanced-student", "racket", "racket/base"... and whatever other languages > this DrRacket knows. Default alternative would be "Guess", which I suspect > will work fine for most people. > > The "Guess" alternative in this preference could be some heuristics like > Emacs and the "file" command use (later on we could make these heuristics > extensible by packages that implement languages), and default to the last > #lang used. I suspect last-#lang-used would be fine, and any heuristics are > a bonus. (The heuristics might determine language of the file as distinct > from #lang languages, and for each file language, keep track of a > last-#lang-used. So, a heuristic might recognize Scheme as the file's > language, and then Guess would go and find what #lang the user last used for > a Scheme file. Again, last-#lang-used, with no heuristics, is fine 95%+ of > the time; heuristics are mostly for delighting the user with DrRacket's > cleverness the other 5% of the time.) > > Robby's suggestion of *always* requiring #lang is tempting, and I am close > to that, except that it would be nice to support languages that don't > syntactically permit #lang. For example, if we wanted to load up > JavaScript, XML, HTML, or Java files in DrRacket. > > Neil V. > > -- > http://www.neilvandyke.org/ > > > _ > Racket Developers list: > http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
I know I'm not a contributor (yet), but I think it would be nice if #lang always took priority, and a warning would appear if the #lang overrode the language drop-down (drop-up in DrRacket I guess). I don't think anyone using the teaching languages ever uses #lang, and when they do it's usually because they are moving on to other languages (at least temporarily). On Wed, Mar 21, 2012 at 9:04 AM, Sam Tobin-Hochstadt wrote: > On Wed, Mar 21, 2012 at 10:48 AM, Robby Findler > wrote: > > > >> Also, Roger (the bug reporter) tried basically all the languages in > >> the dialog, but did not understand that "Use the language declared in > >> the source" was even an option. > > > > Ugh. That's unfortunate. We spent a lot of time trying to make that > > dialog clear. > > Here are a few ideas for improving it: > > 1. Include some examples of #lang lines under the #lang option. > > 2. Change option 2 to be "Use a teaching language", with *only* the > teaching langauges listed. Then have a button to show the other > languages. This would also cut down on the number of people who > choose R5RS without knowing what they're doing. > > 3. Like option 2, but put even the teaching languages behind the > button. This would make it hard to get confused as a newcomer to > Racket, but students would need more explanation. > > I think both 1 and 2 are good ideas, and we could do them without > inconveniencing people. 3 is more controversial. > > -- > sam th > sa...@ccs.neu.edu > _ > Racket Developers list: > http://lists.racket-lang.org/dev > _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
How about a change to the purpose of the Languages control? Currently, I think of the control *selecting how to determine* which language to use. Example settings "whatever #lang says", "Beginning Student", etc. The control could be changed to *present the determination* (by #lang or by some default), and only secondarily as a means to *change the determination* (which might mean automatically changing the #lang in the file). The list of override alternatives would be something like the languages that this DrRacket instance knows about. There would not be a "whatever #lang says" alternative, since that behavior is always the case. For determining the language when no #lang is present (such as when opening a file without a #lang, or when creating a new file), the default could be a preference setting, with alternatives like "Guess", "beginning-student", "advanced-student", "racket", "racket/base"... and whatever other languages this DrRacket knows. Default alternative would be "Guess", which I suspect will work fine for most people. The "Guess" alternative in this preference could be some heuristics like Emacs and the "file" command use (later on we could make these heuristics extensible by packages that implement languages), and default to the last #lang used. I suspect last-#lang-used would be fine, and any heuristics are a bonus. (The heuristics might determine language of the file as distinct from #lang languages, and for each file language, keep track of a last-#lang-used. So, a heuristic might recognize Scheme as the file's language, and then Guess would go and find what #lang the user last used for a Scheme file. Again, last-#lang-used, with no heuristics, is fine 95%+ of the time; heuristics are mostly for delighting the user with DrRacket's cleverness the other 5% of the time.) Robby's suggestion of *always* requiring #lang is tempting, and I am close to that, except that it would be nice to support languages that don't syntactically permit #lang. For example, if we wanted to load up JavaScript, XML, HTML, or Java files in DrRacket. Neil V. -- http://www.neilvandyke.org/ _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
On Wed, Mar 21, 2012 at 10:48 AM, Robby Findler wrote: > >> Also, Roger (the bug reporter) tried basically all the languages in >> the dialog, but did not understand that "Use the language declared in >> the source" was even an option. > > Ugh. That's unfortunate. We spent a lot of time trying to make that > dialog clear. Here are a few ideas for improving it: 1. Include some examples of #lang lines under the #lang option. 2. Change option 2 to be "Use a teaching language", with *only* the teaching langauges listed. Then have a button to show the other languages. This would also cut down on the number of people who choose R5RS without knowing what they're doing. 3. Like option 2, but put even the teaching languages behind the button. This would make it hard to get confused as a newcomer to Racket, but students would need more explanation. I think both 1 and 2 are good ideas, and we could do them without inconveniencing people. 3 is more controversial. -- sam th sa...@ccs.neu.edu _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
Unfortunately, we're not quite there yet. We do have the pane (but with the #lang present), but the lack of the other things is mostly a concession to the fact that it isn't yet the case that every source file in DrRacket should begin with "#lang". Only most. Robby On Wed, Mar 21, 2012 at 8:12 AM, Stephen Bloch wrote: > The whole #lang thing has bothered me for a long time. How about this? > > EVERY Racket source file is supposed to start with a #lang line, which > DrRacket shows in a separate (non-scrollable, one-line) pane, hiding the word > #lang, since it MUST be there and therefore provides the user no information. > The "choose language" menu commands would simply replace the contents of > this pane with one of several bundled language names. If you don't want to > use one of the bundled ones, you can type into this pane yourself, and the > next time you hit "run", either that language is found or it isn't. > > If you open a Racket source file in a text editor, you see the same #lang > line you see now. > > What to do with legacy source files that don't have #lang lines? That > shouldn't be insurmountable > > Stephen Bloch > sbl...@adelphi.edu _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
On Wed, Mar 21, 2012 at 7:47 AM, Sam Tobin-Hochstadt wrote: > On Wed, Mar 21, 2012 at 8:44 AM, Robby Findler > wrote: >> I think the only place we encourage users to not use that is the >> teaching languages, right? > > Yes, that's right, but people who've already used the student > languages are a big constituency for things like the "Quick" tutorial. Oh, I didn't mean to dispute that. I have been very very very tardy in getting #lang htdp/bsl and co. going. > Also, Roger (the bug reporter) tried basically all the languages in > the dialog, but did not understand that "Use the language declared in > the source" was even an option. Ugh. That's unfortunate. We spent a lot of time trying to make that dialog clear. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
The whole #lang thing has bothered me for a long time. How about this? EVERY Racket source file is supposed to start with a #lang line, which DrRacket shows in a separate (non-scrollable, one-line) pane, hiding the word #lang, since it MUST be there and therefore provides the user no information. The "choose language" menu commands would simply replace the contents of this pane with one of several bundled language names. If you don't want to use one of the bundled ones, you can type into this pane yourself, and the next time you hit "run", either that language is found or it isn't. If you open a Racket source file in a text editor, you see the same #lang line you see now. What to do with legacy source files that don't have #lang lines? That shouldn't be insurmountable Stephen Bloch sbl...@adelphi.edu _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
On Wed, Mar 21, 2012 at 8:44 AM, Robby Findler wrote: > I think the only place we encourage users to not use that is the > teaching languages, right? Yes, that's right, but people who've already used the student languages are a big constituency for things like the "Quick" tutorial. Also, Roger (the bug reporter) tried basically all the languages in the dialog, but did not understand that "Use the language declared in the source" was even an option. > > Robby > > On Wed, Mar 21, 2012 at 7:05 AM, Sam Tobin-Hochstadt > wrote: >> The below email transcript indicates that we're still having problems >> communicating how to use the language dialog to users. Maybe a >> screenshot in the "Quick" tutorial would help, although I think the >> only real solution is to move to using #lang for everything. >> >> >> -- Forwarded message -- >> From: Roger Tobie >> Date: Tue, Mar 20, 2012 at 10:18 PM >> Subject: Re: [racket-bug] all/12642: #lang slideshow gets error >> message "module: this function is not defined" >> To: Sam Tobin-Hochstadt >> >> >> Good evening, >> >> Yes, it works. Thank you! >> >> However, I would argue that the signifigance of the the top bullet >> item in the pop up Choose Language menu is not at all obvious to a >> newbie such as myself. Perhaps the directions in "Quick: An >> Introduction to Racket with Pictures" could include an explanation of >> the requirement of this choice and say something to the effect that >> before you type in #lang slideshow you must choose "Use the language >> declared in the source" in the dialog box. This was not clear to me >> from the directions given in the introduction. Also the statement >> #lang slideshow has to replace what is automatically generated by >> choosing the bullet for "Use the language in the source". It can't be >> typed below it or you get another error message when you click on Run, >> although the new error message is pretty self explanatory. >> >> Again, thank you >> Roger Tobie >> >> >> On 3/20/2012 6:21 PM, Sam Tobin-Hochstadt wrote: >>> >>> On Tue, Mar 20, 2012 at 6:14 PM, Roger Tobie wrote: On 3/19/2012 7:22 PM, Sam Tobin-Hochstadt wrote: On Mon, Mar 19, 2012 at 6:44 PM, wrote: *** Description: Load and start DrRacket. Then following the instructions in Quick: An Introduction to Racket with Pictures under step 2 Set... Copy the following into the definitions area #lang slideshow Then click the Run button. I did this and get the message "module: this function is not defined" in the interactions area. This is pretty frustratting to someone just trying to get started with Racket. Right below that paragraph is the following discussion of setting up DrRacket to use the language declared in the source: If you’ve used DrRacket before, you might need to reset DrRacket to use the language declared in the source via the Language|Choose Language... menu item before clicking Run. If you follow those instructions, does the error go away? Hello, Sam Tobin-Hochstadt, Thank you for your prompt reply. No, the error does not go away. I have followed the above instructions and tried all the the entries under Teaching Languages / How to design programs with the same result. I had done this many times before I sent my bug report and just repeated these tests to make doubly sure. It is interesting that Pretty Big under Legacy Languages does not give this error message when I tell it to run #lang slideshow, but then when I type in and try to execute (circle 10) I get "reference to undefined identifier: circle". Also, I am not sure exactly what is meant by the phrase "reset DrRacket to use the language declared in the source". What source? >>> >>> In the "Language" dialog, please choose the "Use the language declared >>> in the source" option, which is at the top of the dialog box. Then >>> see if the program works. >>> >>> >> >> >> >> >> -- >> sam th >> sa...@ccs.neu.edu >> >> _ >> Racket Developers list: >> http://lists.racket-lang.org/dev -- sam th sa...@ccs.neu.edu _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Fwd: [racket-bug] all/12642: #lang slideshow gets error message "module: this function is not defined"
I think the only place we encourage users to not use that is the teaching languages, right? Robby On Wed, Mar 21, 2012 at 7:05 AM, Sam Tobin-Hochstadt wrote: > The below email transcript indicates that we're still having problems > communicating how to use the language dialog to users. Maybe a > screenshot in the "Quick" tutorial would help, although I think the > only real solution is to move to using #lang for everything. > > > -- Forwarded message -- > From: Roger Tobie > Date: Tue, Mar 20, 2012 at 10:18 PM > Subject: Re: [racket-bug] all/12642: #lang slideshow gets error > message "module: this function is not defined" > To: Sam Tobin-Hochstadt > > > Good evening, > > Yes, it works. Thank you! > > However, I would argue that the signifigance of the the top bullet > item in the pop up Choose Language menu is not at all obvious to a > newbie such as myself. Perhaps the directions in "Quick: An > Introduction to Racket with Pictures" could include an explanation of > the requirement of this choice and say something to the effect that > before you type in #lang slideshow you must choose "Use the language > declared in the source" in the dialog box. This was not clear to me > from the directions given in the introduction. Also the statement > #lang slideshow has to replace what is automatically generated by > choosing the bullet for "Use the language in the source". It can't be > typed below it or you get another error message when you click on Run, > although the new error message is pretty self explanatory. > > Again, thank you > Roger Tobie > > > On 3/20/2012 6:21 PM, Sam Tobin-Hochstadt wrote: >> >> On Tue, Mar 20, 2012 at 6:14 PM, Roger Tobie wrote: >>> >>> On 3/19/2012 7:22 PM, Sam Tobin-Hochstadt wrote: >>> >>> On Mon, Mar 19, 2012 at 6:44 PM, wrote: >>> >>> *** Description: >>> Load and start DrRacket. Then following the instructions in Quick: An >>> Introduction to Racket with Pictures under step 2 Set... Copy the following >>> into the definitions area #lang slideshow Then click the Run button. >>> I did this and get the message "module: this function is not defined" in the >>> interactions area. This is pretty frustratting to someone just trying >>> to get started with Racket. >>> >>> Right below that paragraph is the following discussion of setting up >>> DrRacket to use the language declared in the source: >>> >>> If you’ve used DrRacket before, you might need to reset DrRacket >>> to use the language declared in the source via the >>> Language|Choose Language... menu item before clicking Run. >>> >>> If you follow those instructions, does the error go away? >>> >>> Hello, Sam Tobin-Hochstadt, >>> >>> Thank you for your prompt reply. >>> >>> No, the error does not go away. I have followed the above instructions and >>> tried all the the entries under Teaching Languages / How to design programs >>> with the same result. I had done this many times before I sent my bug report >>> and just repeated these tests to make doubly sure. It is interesting that >>> Pretty Big under Legacy Languages does not give this error message when I >>> tell it to run #lang slideshow, but then when I type in and try to execute >>> (circle 10) I get "reference to undefined identifier: circle". >>> >>> Also, I am not sure exactly what is meant by the phrase "reset DrRacket to >>> use the language declared in the source". What source? >> >> In the "Language" dialog, please choose the "Use the language declared >> in the source" option, which is at the top of the dialog box. Then >> see if the program works. >> >> > > > > > -- > sam th > sa...@ccs.neu.edu > > _ > Racket Developers list: > http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev