Re: [racket-users] Equivalent of exec
> started as a quick experiment with scsh a number of years ago, I’m surprised no one has mentioned Rash so I will ... perhaps Rash will be a useful tool for you ... https://docs.racket-lang.org/rash/ “2 Rash Guide ... Rash is a shell language embedded in Racket. “ https://rash-lang.org/ Cheers, Kieron -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/182D8C35-5857-4FEC-8B59-525FDBC035F6%40gmail.com.
Re: [racket-users] Historical note.
> On Nov 8, 2020, at 2:58 PM, Hendrik Boom wrote: > >> On Sun, Nov 08, 2020 at 12:47:11PM -0800, unlimitedscolobb wrote: >> The idea of having structs whose fields contain functions has never occurred >> to me ... > > Historical note: > > I first encountered structures containing function in the source code for > OS/360 way back in the late 60's. In assembler. > > -- hendrik > Structures with fields containing functions has never occurred to me before, either, at least not in those terms. However isn’t that exactly one of the key design principles behind how device-drivers are implemented and installed into an OS? And also how classes and objects were initially added to C as some pretty hairy #define macros and function pointers? This design pattern insight would have been beneficial to me sooner - doh! — Kieron -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/ADDB8BD2-9A4B-478E-B296-7EF44392466A%40gmail.com.
Re: [racket-users] scribble: how to put a bar above text?
FYI: As of Windows 10, you can install a full Linux distro in/on Windows. Here are the instructions: https://docs.microsoft.com/en-us/windows/wsl/install-win10 > On Jun 16, 2020, at 11:39 AM, Jos Koot wrote: > > Hi, > Thanks for your prompt reply. > I’ll first look into Mathjax. It’s on github, so I suppose I can download it > without charges. > Using head-extra seems straight forward, but I never used it before. I’ll see > what happens. > I hope it works with the scribble HTML button in DrRacket, for it seems I do > not have the required software to use the scribble PDF button. (I tried to > download the required software, but it did not work. May be windows 10 poses > a problem (well, it always does). It would be nice to have Unix as a > subsystem within windows, but I don’t know whether or not that is possible.) > Thanks again, Jos > > > From: Stephen De Gabrielle > Sent: 16 June 2020 19:02 > To: Jos Koot > Cc: us...@racket-lang.org > Subject: Re: [racket-users] scribble: how to put a bar above text? > > Hi Jos > > MathML support via the tag is not good. > > I suspect the best option is to use Mathjax > https://www.mathjax.org/#gettingstarted > > I think you use `head-extra`[1] to add the required script tags[2] to your > file. (not done this myself though so I'm not sure how) > > [1] > https://docs.racket-lang.org/scribble/core.html#%28def._%28%28lib._scribble%2Fhtml-properties..rkt%29._head-extra%29%29 > > [2] > https://polyfill.io/v3/polyfill.min.js?features=es6"> > src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"> > > -- > 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. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/5ee903dd.1c69fb81.14578.f52a%40mx.google.com. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/873D89F5-9963-421F-B151-2485CFC38392%40gmail.com.
Re: [racket-users] Re: Gracket format
> >> What version of Windows? >> > > MacOS 10.14.6 :) Mac, huh? I didn’t know Gracket was needed there. Sorry, I’m no help. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/E01A615A-DCF8-49E5-B155-42BADB80200E%40gmail.com.
Re: [racket-users] Gracket format
Hi Mark, How are you starting your program? Are you launching Racket from a command line or launching by e.g. double-clicking an icon in the Windows window manager? What version of Windows? Cheers, Kieron > On Aug 28, 2019, at 5:44 AM, Mark Bestley wrote: > > I am just learning racket using the real of Racket book. > > However I am have problems wil file formats. > My .rkt file has become gracket format but I have no images or any non > ascii/unicode text in it. This messes up version control and use of other > editors. > > How can I force DrRacket not to corrupt the text file? and only change if I > add images? > > The only odd thing I think I have done that might matter is Collapse > S-expression. > > > -- > Mark > > > -- > 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. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/m1h861o6ou.fsf%40bestley.co.uk. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/9E2FAA33-BF22-402B-B3FD-8E09E3461495%40gmail.com.
Re: [racket-users] snake game
The language you should be using is "Beginning Student with List Abbreviations". > On Jan 24, 2019, at 4:33 AM, orenpa11 wrote: > > Hi, > when I removed the line > #reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname snake-full) > (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor > repeating-decimal #f #t none #f ( > > And changed the language to pretty big. > I recived this error: > Welcome to DrRacket, version 7.1 [3m]. > Language: Pretty Big; memory limit: 128 MB. > . . check-expect: undefined; > cannot reference an identifier before its definition > > Any idea ? > > Thanks, > Or > > > > > >> On Wednesday, January 23, 2019 at 10:49:01 PM UTC+2, Kieron Hardy wrote: >> It seems the metadata lines added by DrRacket (mentioned by John) are >> processed when the a source file is loaded into DrRacket (via the menu >> option File/Open), but are not processed if the source code is directly >> copied (e.g. from a browser window) into a DrRacket window and then executed >> with the 'Run' button. >> >> The metadata includes a #reader directive, e.g.: >> (#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname snake-full) >> ...) >> >> This reader directive appears to be silently ignored by DrRacket when the >> source is 'Run', even though DrRacket shows "#reader" in red (as when an >> error is detected). The actions taken by DrRacket when 'Run' is pressed seem >> to depend on the settings in effect when the code is executed, which could >> be nothing, or throwing a confusing error. >> >> The solution for the original poster's issue is as John directs; remove the >> metadata (i.e. #reader directive) and manually set the language. >> >> However, I feel that DrRacket should recognize and act on (and perhaps also >> remove/hide from view) the metadata if the metadata occurs as from a >> copy/paste directly into a DrRacket window (e.g. as from a URL). The current >> behaviour is, I think, a bug and a trap (perhaps showstopping) for a new >> user experimenting with Racket. >> >> Note that the Racket executable seems to process the metadata properly, >> understanding the language to use, etc.. so that the code behaves as >> intended. >> >>> On Wed, Jan 23, 2019 at 12:32 PM K H wrote: >>> Hello Or, >>> >>> The language is not "Pretty Big". >>> >>> You should be using "Beginning Student with List Abbreviations". >>> >>> The DrRacket metadata lines referred to by John set the correct language. >>> In your case you must have changed the language somehow. Or perhaps the >>> file needs to be saved before the metadata is acted upon. >>> >>> HTH, >>> >>> Kieron. >>> >>> >>>> On Wed, Jan 23, 2019 at 12:17 PM 'John Clements' via Racket Users >>>> wrote: >>>> Interesting problem; your screenshot shows header text that should not >>>> appear in the window, which suggests to me that you copied and pasted the >>>> text from somewhere else into a buffer where the language level was >>>> already set. It looks to me like you should do the following: >>>> >>>> 1) Delete the first three lines of the file. >>>> 2) Set the language level to “beginner with list abbreviations”. >>>> 3) Click “run” >>>> >>>> John Clements >>>> >>>> > On Jan 23, 2019, at 10:44 AM, orenpa11 wrote: >>>> > >>>> > Hi David, >>>> > Thanks for your swift response ,I simply do not know how to run this >>>> > program. >>>> > I thought that when I press the run button I should see the snake GUI . >>>> > >>>> > Maybe the language is not pretty big ? >>>> > Thanks, >>>> > Or >>>> > >>>> > >>>> > On Wednesday, January 23, 2019 at 8:25:32 PM UTC+2, David K. Storrs >>>> > wrote: >>>> > What happens when you run it? Are you getting any error messages? >>>> > >>>> > On Wed, Jan 23, 2019 at 1:01 PM orenpa11 wrote: >>>> > > >>>> > > Hi >>>> > > I am trying to implemet this code of "snake game " >>>> > > https://course.ccs.neu.edu/csu211/code/snake-full.ss >>>> > > >>>> > > in DrR
[racket-users] Resubmitting PRs after build problems
Hi all, I have noticed that some recent PRs have failed the Travis CI build step seemingly due to unrelated, perhaps infrastructure-y, problems. e.g. The PR I submitted, via a Github edit that fixes a typo in a comment, failed the tests on one target with a tcp-connect timeout error (errno=60). Of course, only PRs that pass the build will be reviewed by others and then possibly merged into the Racket source proper. And so, using the Github web interface, I looked in vain for some option to "re-build" my stalled PR, ending up accidentally closing the PR. When I reopened and resubmitted the PR, the build proceeded and completed successfully (and the PR was then merged, thanks Vincent). Is there a better procedure (other than close/open/resubmit PR) to redo a build that failed? Is there some way to get a "build failed" message automatically sent to the PR submitter? I only noticed that my PR's build had failed by looking on Github manually, a step that others may not think to perform; I did a quick look at some of the other PRs with build failures and see several with similar issues to mine. Cheers, Kieron. -- 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.
[racket-users] error during prompt calculation: path->string: contract violation
Hello all, On Windows, I noticed that Racket's initialization file is incorrectly set to %HOMEDIRVE%\%HOMEPATH%\.racketrc.rktl $ grep 'WINDOWS_INIT_FILENAME' -r . ./racket-master/racket/src/gracket/grmain.c:#define WINDOWS_INIT_FILENAME "%%HOMEDIRVE%%\\%%HOMEPATH%%\\gracketrc.rktl" ./racket-master/racket/src/racket/main.c:# define WINDOWS_INIT_FILENAME "%%HOMEDIRVE%%\\%%HOMEPATH%%\\racketrc.rktl" ./racket-master/racket/src/racket/main.c:# define INIT_FILENAME WINDOWS_INIT_FILENAME (The correct location should of course be on %HOMEDRIVE%). Having never used a Racket initialization file, I set about developing a test case to demonstrate the error in code using for inspiration Greg Hendershott's answer regarding interactive use of Racket on SO (see https://stackoverflow.com/a/19876947/1689714). I set %HOMEDRIVE%\%HOMEPATH%\.racketrc.rktl to (require xrepl), and was surprised to see no issue with actually using definitions from xrepl after starting the racket executable. I soon realized that as the "current drive" was the same as %HOMEDRIVE% (i.e. 'C:') the failure to evaluate %HOMEDIRVE% would not be noticed since %HOMEPATH% alone would be enough to locate the file .racketrc.rktl. So ... I copied the 'foo.rkt' test file, and changed the shell's current directory, to 'D:\', launched the racket executable and got: D:\>racket Welcome to Racket v6.12. > (enter! "foo.rkt") ; error during prompt calculation: path->string: contract violation expected: path? given: "d:\\foo.rkt" [internal-error]> This seems to be the result of another issue entirely unconnected to the problem of locating the initialization file, and one I am not able to chase any further at the moment. Should I submit an error report? Cheers, Kieron. -- 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.
Re: [racket-users] The Little Schemer, misprint?
Thanks, Ben. Of course you are right. I was somehow fixated and had lost the context. Sorry for the noise. > On Feb 25, 2017, at 9:34 AM, Ben Greenman <benjaminlgreen...@gmail.com> wrote: > > The printed explanation is giving the meaning of the whole line (in the > context of the call to member) --- not just the meaning of the application > (null? lat) > > Hope this helps > > >> On Sat, Feb 25, 2017 at 11:17 AM, Kieron Hardy <kieron.ha...@gmail.com> >> wrote: >> I'm going through The Little Schemer (Fourth Edition). On page 23 the first >> question posed asks: >> What is the meaning of the line >> >> ((null? lat) #f) >> >> where >> lat is (mashed potatoes and meat gravy) >> >> The printed explanation seems to be a misprint as it appears to be the >> answer to a different question: >> (null? lat) asks if lat is the null list. If it is, the value is #f, since >> the atom meat was not found in lat. If not, we ask the next question. In >> this case, it is not null, so we ask the next question . >> >> Is the printed answer wrong, or am I missing something? >> >> Cheers, >> >> Kieron >> -- >> 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.
[racket-users] The Little Schemer, misprint?
I'm going through The Little Schemer (Fourth Edition). On page 23 the first question posed asks: What is the meaning of the line ((null? lat) #f) where lat is (mashed potatoes and meat gravy) The printed explanation seems to be a misprint as it appears to be the answer to a different question: (null? lat) asks if lat is the null list. If it is, the value is #f, since the atom meat was not found in lat. If not, we ask the next question. In this case, it is not null, so we ask the next question . Is the printed answer wrong, or am I missing something? Cheers, Kieron -- 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.
[racket-users] Exception handling on cygwin/windows
The code for 'signal handling' with racket at Rosetta Code: #lang racket (define now current-milliseconds) (define start (now)) (with-handlers ([exn:break? (λ(x) (define elapsed (/ (- (now) start) 1000.)) (displayln (~a "Total time: " elapsed)))]) (for ([i (in-naturals)]) (displayln i) (flush-output) (sleep 0.5))) (see https://rosettacode.org/wiki/Handle_a_signal#Racket) works as expected on windows in a DOS command window at the command line: i.e.The exception handler catches the 'interrupt' and 'terminate' (or is it 'quit'?) signals generated from pressing on the keyboard; 'ctrl-c' for interrupt and 'break' for terminate/quit. However: in a cygwin bash terminal window the program responds to 'ctrl-c' by quitting racket silently, and responds to 'break' by quitting racket after outputting the text 'Quit' Note: I needed to add a (flush-output) to flush the output buffer which seems to be necessary under cygwin, which without the flush only wrote to the window when the output buffer filled. Is the failure to call the correct exception handler caused by running 'Racket for Windows' under cygwin? Do I need to install into cygwin a version of racket that was built by cygwin? Do I need to re-configure something in cygwin? (e.g. with tset?) I did a little bit of a google and haven't found anything relevant. Thanks for any insight. Cheers, Kieron. -- 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.
Re: [racket-users] Racket Shell
I've been experimenting with 'shell/pipeline' on windows and post some tests and example results here in case they are of use to others: - basic examples demonstrating windows external commands, - basic examples demonstrating windows internal commands with standard cmd.shell, - basic examples demonstrating windows internal commands with 'new' powershell.cmd shell, - a more complex example showing a command pipeline using powershell commands to do sed-like and grep-like operations. Cheers, Kieron. Examples using Windows external commands: #lang racket/base ; windows-pipeline-1.rkt - basic windows commands with output to stdout and stderr (require shell/pipeline) ; run racket, do arithmetic (run-pipeline '(racket -e "(+ 41 1)") ) ; run java, get java version (run-pipeline '(java -version) ) ; run where, find location of windows where.exe on path (run-pipeline '(where where) ) ; run where, find location of windows cmd.exe on path (run-pipeline '(where cmd) ) Example execution from Windows command prompt: C:\home\racket\shell>racket windows-pipeline-1.rkt > windows-pipeline-1.rkt.out 2>&1 C:\home\racket\shell>type windows-pipeline-1.rkt.out 42 java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode) C:\Windows\System32\where.exe C:\Windows\System32\cmd.exe 0 0 0 0 Examples using Windows internal commands, i.e. commands built-in to the cmd.exe shell: #lang racket/base ; windows-pipeline-2.rkt - basic windows internal (cmd.exe) commands with output to stdout and stderr (require shell/pipeline) ; note: run cmd.exe with /c switch to terminate cmd.exe after executing the given command, i.e. terminate without needing to execute the 'exit' command ; run windows cmd.exe shell, run internal 'dir' command to get directory listing of the root of C: drive (run-pipeline '(cmd /c dir C:\\) ) ; run windows cmd.exe shell, run internal 'set' command to the get a complete listing of the environment variables and their values (run-pipeline '(cmd /c set) ) ; run windows cmd.exe shell, run internal 'echo' command to send arguments to standard out (run-pipeline '(cmd /c echo hello world) ) ; run windows cmd.exe shell, run internal 'path' command to get the value of the PATH environment variable (run-pipeline '(cmd /c path) ) ; run windows cmd.exe shell, run internal 'echo' command to get the value of the PATH environment variable (run-pipeline '(cmd /c echo %PATH%) ) Example execution from Windows command prompt: C:\home\racket\shell>racket windows-pipeline-2.rkt > windows-pipeline-2.rkt.out 2>&1 C:\home\racket\shell>type windows-pipeline-2.rkt.out Volume in drive C is Windows Volume Serial Number is 4A0E-59A3 Directory of C:\ 05/06/2016 10:53 PM Analytics 07/06/2015 09:57 AM Brother 09/14/2015 07:49 AM cygwin64 01/08/2016 05:00 PM data 11/04/2015 02:18 PM 321,531 DUMP38fa.tmp 09/20/2016 02:51 PM home 12/22/2014 07:04 PM Intel 07/02/2015 01:19 PM OSGeo4W64 07/13/2009 09:20 PM PerfLogs 08/28/2016 08:48 PM Program Files 09/20/2016 09:21 AM Program Files (x86) 09/09/2015 05:50 PM Python27 11/12/2015 01:16 PM Python27_64 08/29/2016 02:47 PM SWSETUP 09/20/2016 09:02 AM tools 06/19/2015 02:41 PM Users 08/02/2015 02:12 PM wamp 09/14/2016 11:48 AM Windows 09/07/2016 07:35 PM42 windows-version.txt 2 File(s)321,573 bytes 17 Dir(s) 366,015,729,664 bytes free ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\Kieron\AppData\Roaming asl.log=Destination=file CLASSPATH=.;C:\tools\apple\QuickTime\QTSystem\QTJava.zip CommonProgramFiles=C:\Program Files (x86)\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=NIETZSCHE ... hello world PATH=C:\ProgramData\Oracle\Java\javapath;C:\tools\racket\racket32_6.5\Racket;C:\Program Files (x86)\... C:\ProgramData\Oracle\Java\javapath;C:\tools\racket\racket32_6.5\Racket;C:\Program Files (x86)\... 0 0 0 0 0 Examples using Windows powershell shell: #lang racket/base ; windows-pipeline-3.rkt - basic windows internal (powershell.exe) commands with output to stdout and stderr (require shell/pipeline) ; note: run powershell.exe with /Command switch to terminate powershell.exe after executing the given command, i.e. terminate without needing to execute the 'exit' command ; run windows external command 'where.exe', find location of windows powershell.exe on path (run-pipeline '(where powershell) ) ; run windows powershell.exe shell, run internal 'echo' command to get the value of the arguments to standard out (run-pipeline '(powershell /Command "& {echo Hello World}") ) ; run windows powershell.exe
Re: [racket-users] Re: Running racket on a #lang-less module-less file?
+1 Yes, specifying the language to use when interpreting some source, is best in the input source itself than in the reference to that source. But why must it be one or the other, and not some sensible combination of both. e.g. If the #lang is absent from the source, look for and/or override the language to use with command line switches to the interpreter, with #lang racket (or racket/base or something else) as the default. The only way Racket-created solutions can supplant the products created with medieval tools (and I'm thinking here of lex, yacc, and their ilk) is by ingesting the exact same input source files/streams that those other products ingest. Forcing a change to input source is an unnecessary, difficult, and often insurmountable hurdle. Evolving replacement Racket-built solutions in (one of the many) domains where Racket is ideal should be easy. > On May 7, 2016, at 6:48 AM, Jay McCarthywrote: > > +1 > >> On Fri, May 6, 2016 at 6:13 PM, Jack Firth wrote: >> William's remark is spot on about my use-case. There exists a language that >> wasn't initially designed with racket in mind, but could easily be a racket >> #lang. To interop with code already written in this language, I wanted an >> easy way to run files that don't have the #lang line. If I were designing >> the language Racket-first, I wouldn't need this feature. >> >> -- >> 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. > > > > -- > Jay McCarthy > Associate Professor > PLT @ CS @ UMass Lowell > http://jeapostrophe.github.io > > "Wherefore, be not weary in well-doing, > for ye are laying the foundation of a great work. > And out of small things proceedeth that which is great." > - D 64:33 > > -- > 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.