Re: [racket-users] Re: I Need Help Bringing Vulkan to Racket
Oh cool. I've never actually looked at this dynamic-ffi package. Although IIRC, the RacketGL bindings themsleves were generated by swig: http://www.swig.org/ On 10/21/19, Paulo Matos wrote: > > > On Wednesday, 9 October 2019 22:56:48 UTC+2, Sage Gerard wrote: >> >> I'm resuming work on a very early-stage project that generates FFI >> bindings for Vulkan in Racket [1]. VkTk is the closest relative project I >> >> have found for reference [2]. >> >> Last time I was on the project I was focused on generating bindings from >> the API registry. That has not changed. I considered use of Dave Herman's >> C >> library [3] on vulkan.h directly, but the XML spec has supplemental data, >> >> and vulkan.h has preprocessor directives that I would like to capture for >> >> completeness. >> >> Once I am finished with the bindings. would anyone be available to >> contribute/run tests in the hopes that we can make this viable faster? I >> intend to run any applications on Windows 10 and a 1080Ti, but that's >> about >> all of the configurations that I can verify. I'll definitely need guinea >> pigs and feedback. >> >> > Hi Sage, > > Thanks for this effort. > I have a large machine - currently used for Racket CI, which could be used > for running these tests as well. A separate machine specifically for > benchmarking is available as well. > Give me a pvt. shout to arrange this. > > Paulo > > >> [1]: https://github.com/zyrolasting/racket-vulkan >> [2]: https://github.com/awolven/VkTk >> [3]: https://docs.racket-lang.org/c-utils/index.html >> >> *~slg* >> >> >> > > -- > 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/9ee51764-bbbe-4328-8d04-8a3d18a65649%40googlegroups.com. > -- ~Leif Andersen -- 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/CAAVaeEDpwKqm8aTeihWvmxB%2B-3otD1RsmFE%2BQL25m9CKenOsRw%40mail.gmail.com.
Re: [racket-users] Can I use the macro stepper to debug an infinite expansion loop?
Unfortunately no. The macro stepper requires macros to fully expand before it can let you step through them. You can, however, use this `obs.rkt` file (attached) to debug macros as they are expanding, and will print the current expanding syntax to stdout. While not the most convenient thing in the world, I have been able to use it to debug some pretty large and hairy macros. (Thanks to Michael Ballentyne for giving me the original script.) On 7/29/19, William J. Bowman wrote: > Can I use the macro stepper to debug a bug in some code that seems to be > macro > expanding infinitely? > Is it in a sandbox to prevent infinite macro expansion or something? > It looks like DrRacket's background expander allows me to kill expansion > after a > short time, but when launching the macro stepper, it just hangs... or maybe > the > timeout is longer than I'm willing to wait. > > -- > William J. Bowman > > -- > 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/20190729175903.GA22568%40williamjbowman.com. > -- ~Leif Andersen -- 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/CAAVaeEAz0Q2piaCHeJE4beCzsHeqrvFXqFgDTjmRsrJzOWqd1A%40mail.gmail.com. obs.rkt Description: Binary data
Re: [racket-users] using #lang info copy-foreign-libs
A common cause of this is you don't have installed the libraries that the library you're trying to load depends on. Since you are using the libvid library it depends on libavutil, which is not (currently) listed as a dependency in the libvid-x86_64-macosx package[1]. Can you try installing the ffmpeg-x86_64-macosx package on your machine and see if it still works? If not, can you show us the list of files in your /Users/spdegabrielle/Library/Racket/7.2/lib and /Applications/Racket v7.2/lib directories? Hope that helps. [1]: That was my fault. I probably should have listed it. I never really imagined libvid being used without the video package, which _does_ have the required deps. I'll update the deps for that package, thanks for pointing out the problem. On 4/1/19, Stephen De Gabrielle wrote: > Hi, > > I'm trying to work out how to use 'copy-foreign-libs' [1], but not having > much luck. I believe the implementation of the collection using ' > copy-foreign-libs' is correct because it works in '#lang video', but I've > been unable to use it myself. > > I created a collection 'testffi-1' that would make use of the > existing(known working) 'libvid-x86_64-macosx' package [2] used by `#lang > video`. > > I installed 'testffi-1' with 'raco pkg install' , but attempts to call it > with a short test program fail with an error that the foreign library > cannot be found. > > Thinking that I hadn't 'provided'ed the foreign lib to my test script let > me to create a 'main.rkt' in 'testffi-1', but that also fails to fine the > foreign lib with the same error message, and using the DrRacket 'trace' > functionality seems to blame 'kw.rkt' (/Applications/Racket > v7.2/collects/racket/private/kw.rkt: 1325:47), which seems odd to me > because the error is in my code, not in the standard racket libs. > > I used (require setup/dirs > <https://docs.racket-lang.org/raco/dirs.html?q=get-lib-dirs>) to see if the > foreign lib was included, but > get-lib-search-dirs > <https://docs.racket-lang.org/raco/dirs.html#%28def._%28%28lib._setup%2Fdirs..rkt%29._get-lib-search-dirs%29%29> > returns > /Users/spdegabrielle/Library/Racket/7.2/lib /Applications/Racket v7.2/lib > when called from both the test script and the 'testffi-1' collection. > > Any suggestions on how I can test or resolve this issue would be > appreciated. > > Kind regards, > Stephen > > * 'copy-foreign-libs' : * > https://github.com/videolang/native-pkgs/blob/master/libvid-x86_64-macosx/info.rkt > > *test program: * > #lang racket > (require ffi/unsafe) > (require testffi-1) > (define libvid-val (ffi-lib (string-append "libvid") "0")) > (displayln libvid-val) > > > *'main.rkt' in 'testffi-1'* > #lang racket/base > (require ffi/unsafe) > ;(ffi-lib? "libvid.0.dylib") > > (define libvid-val (ffi-lib (string-append "libvid") "0")) > > (displayln libvid-val) > > > *Error* > Welcome to DrRacket, version 7.2 [3m]. > Language: racket, with debugging; memory limit: 2048 MB. > *. . ../../../Applications/Racket > v7.2/collects/racket/private/kw.rkt:1325:47: ffi-lib: couldn't open > "libvid.0.dylib" (dlopen(libvid.0.dylib, 6): image not found)* >> > > *tracing the error : * > ffi-lib: couldn't open "libvid.0.dylib" (dlopen(libvid.0.dylib, 6): image > not found) > ffi-lib: couldn't open "libvid.0.dylib" (dlopen(libvid.0.dylib, 6): image > not found) > > > *package used set deps 'testffi-1' * > #lang info > (define collection "testffi-1") > (define deps '("base" >("libvid-x86_64-macosx" #:platform "x86_64-macosx"))) > (define build-deps '("scribble-lib" "racket-doc" "rackunit-lib")) > (define scribblings '(("scribblings/testffi.scrbl" ( > (define pkg-desc "testffi Description Here") > (define version "0.1") > (define pkg-authors '(spdegabrielle)) > > [1] 'copy-foreign-libs' in '6.3 Controlling raco setup with "info.rkt" > Files' > https://docs.racket-lang.org/raco/setup-info.html?q=copy-foreign-libs#%28idx._%28gentag._21._%28lib._scribblings%2Fraco%2Fraco..scrbl%29%29%29 > > > [2] https://pkgs.racket-lang.org/package/libvid-x86_64-macosx > > -- > 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. > -- ~Leif Andersen -- 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 Video
Glad you're interested in checking out Video. If you need a thing that's not yet in the standard library, please poke me and I'll put it in. Its usually pretty easy to add something at this point, and I tend to do it as people need it. on the list you just sent, Video already supports most of what you are looking for. I'll go down the quickly state what forms I would use. You can also find more about video at https://lang.video. Based > - Take an .mp4 video file and a .wav file, composite them into tracksp `multitrack`. > - Identify initial clap on both audio and video tracks, sync them together Video currently can't automatically find the 'clap', but you can use `playlist` to handle the syncing. > - Delete sound from video track `remove-audio` > - Merge video and audio `multitrack` > - Locate/delete inhale fuzz `highpass/lowpass-filter` > - Cut everything from beginning to 1s before the first spoken word `cut-producer` > - Locate and delete bad takes (a single clap sandwiched between "good > to/from here" spikes (double click)) I'm not sure what you're asking for here. But probably `cut-producer` and `playlist` can do it? > - Grab first five seconds of audio and use it as a profile for noise > reduction across the entire audio Video currently offers highpass, lowpass, bandpass, compand, etc filters, which seem to go a long way to automatically cleaning up spoken word. It currently doesn't support taking a sample and doing noise reduction based on that. I'd be happy to look into that if needed. I presume you were thinking of using libsox for that? > That would eliminate about 90% of the work and I could do the rest > manually. Again, feel free to poke me if you wished something worked differently, or want a feature that is missing. I also regularly check Video's issues on github at: https://github.com/videolang/video/issues Good luck, and happy editing. ~Leif -- 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] Re: Blockly-Like Interface in DrRacket
Stephen, Do you have a link to your current source code? If so I'd be happy to take a look at it and give you general feedback. Also yes, your solution is (very sadly) the current state of the art I have in #lang editor. (https://github.com/videolang/idmt). In the future I hope to improve DrRacket with proper projectional editing capabilities. But yes, at the moment its only really doable by scraping and replacing raw text. ~Leif Andersen On Fri, Apr 27, 2018 at 3:03 PM, Stephen Foster <step...@thoughtstem.com> wrote: > Actually, I figured it out myself. For the curious: > > What I ended up doing was implementing a custom language "#lang > racket-bricks". I used syntax/module-reader's #:wrapper1 to intercept the > code prior to execution. It scrapes out all of the brick-snip%s and > replaces them with their associated S-expressions. > > From the user's perspective, both B-expressions and S-expressions can share > variable bindings. Also, one can nest B-expressions inside S-expressions. > > > I'm planning to use this at ThoughtSTEM to help transition novices smoothly > from block-based coding to traditional coding. > > > > On Thursday, April 26, 2018 at 2:33:35 PM UTC-7, Stephen Foster wrote: >> >> I finally had some time to revisit this. I'm hoping someone can help me >> out a bit more. >> >> >> I made a basic renderer that takes arbitrary S-expressions and renders >> them as bricks. I've made an interface for editing the bricks (and thus >> editing the S-expressions underneath). >> >> >> What I would like to do now is seamlessly integrate these >> brick-expressions (B-expressions?) into arbitrary Racket files using some >> kind of custom snip%. >> >> >> Here's a not-working prototype of what it should look like: >> >> >> >> >> Notice that line #9 has the B-expression. Line #7 has a comment showing >> the equivalent S-expression. Also notice that the B-expression contains a >> reference to the constant defined in an S-expression on line #5. And vice >> versa, notice that the S-expression on line #11 references the constant >> defined in the B-expression. This two-way interoperability between >> B-expressions and S-expressions within the same file is something I think >> would be pedagogically valuable. >> >> >> I'd love to implement this, but I'm looking for suggestions. >> >> >> Let's just suppose I've implemented a special b-expression-snip% class. >> (I haven't, but I think I could). >> >> >> How might I go about getting the above to work. Here are some random, >> vague, probably-misguided musings about implementations -- meant to >> stimulate discussion: >> >> Get DrRacket to render the b-expression-snip% as an image but otherwise >> treat it as a normal S-expression, just as if it had been written as such. >> Get the b-expression-snip%'s associated S-expression to be "evaled" in the >> context of the module -- without having to wrap the snip in a helper >> S-expression, e.g. (my-eval ...). >> Get the b-expression-snip%'s presence to somehow "inject" its S-expression >> into the module/file/etc. >> Implement some kind of special #lang racket-with-bricks that intercepts >> the code before execution and swaps all B-expressions for their associated >> S-expressions. >> >> Any ideas, pointers, references, etc. would all be appreciated. Thanks in >> advance! >> >> >> On Wednesday, December 27, 2017 at 8:30:16 PM UTC-8, Stephen Foster wrote: >>> >>> If I wanted to build a drag-and-drop, visual programming interface for >>> programming in DrRacket, is there any prior work I can build on? Ideally, >>> I'd like to implement this as a DrRacket "snip", so that my students can >>> make programs that are partially text-based and partially visual. Any >>> suggestions? Has anyone done something in the ballpark? > > -- > 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.
Re: [racket-users] Re: RacketCon 2018 Website
Okay, Jay just merged my commit that makes the ascii art work with screen readers. I still don't know if search engines will be able to pick it up (I doubt it though), and its still hard to see when using screen magnifiers. I think if we either used a different font, or slightly increased the space between letters the problem would go away, maybe. Thoughts? ~Leif Andersen On Sat, Apr 21, 2018 at 1:44 AM, Jay McCarthy <jay.mccar...@gmail.com> wrote: > On Sat, Apr 21, 2018 at 1:07 AM, Greg Hendershott > <greghendersh...@gmail.com> wrote: > > 0. Another consideration with the ASCII art font is that it won't get > > indexed by search engines. This doesn't matter so much for the first > > three, since the same info is in the page . But it means > > searching for "Kent Dybvig" won't turn up this page. > > I think that someone with more CSS pizazz than me could put something in > this > > line https://github.com/racket/racket-lang-org/blob/master/ > rcon/2018/pollen.rkt#L117 > > and then in the CSS to put the text directly in there but hide/show it > with certain media-types. > > > 1. The "organizers" href is "http://mailto:jay.mccar...@gmail.com; -- > > which on some browsers opens gmail.com. I think > > "mailto:jay.mccar...@gmail.com; was meant. > > I think this is an error in Pollen or maybe an error in Jay. The code is > > ◊link["mailto:jay.mccar...@gmail.com"]{organizers} > > -- > -=[ Jay McCarthy http://jeapostrophe.github.io]=- > -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=- > -=[ Moses 1:33: And worlds without number have I created; ]=- > > -- > 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] RacketCon 2018 Website
When looked as a whole, the new racketcon website looks cool. But when you are zoomed in (like I and many other blind/low-vision users frequently are), it looks something like this: Which honestly looks like something is broken with the website. Also, it completely kills screen readers. Here is a capture of what a screen reader thinks that block of text is saying: So, if we are going to keep this logo, could we at least make it an image, or use HTML accessibility tags to say what that block of text should be read as, or something else that doesn't completely kill the website for blind users? ~Leif Andersen -- 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] Blockly-Like Interface in DrRacket
Hello Stephens (this is going to be fun...I just know it.) As Stephen D pointed out, there was a push to add traditional gui elements to DrScheme (now DrRacket), which currently lives in the `embedded-gui`[1] collection. Although honestly, that library is old and hasn't been maintained for years. Another alternative is my editor collection which is still in VERY early stages of development[2], but it also lets you build editors in DrRacket. I'm still making a cleaner interface for it, and ultimately I would like to be able to make a nice graphical video editor with it. (Powered by #lang video[3]). But for now, you can see an example of doing a similar thing (making a video editor that is embedded directly in code) on github[4]. Good luck Stephen F. and feel free to ping me if you have any questions. [1]: https://docs.racket-lang.org/embedded-gui/index.html [2]: https://github.com/videolang/idmt [3]: https://lang.video [4]: https://github.com/videolang/video/blob/master/video/private/editor.rkt ~Leif Andersen On Monday, January 1, 2018 at 12:39:10 PM UTC-5, Stephen Foster wrote: > > Yes, exactly -- Like Snap! except I don't need the runtime, just the code > editing paradigm. > > I googled for insert-gui and the closest thing I found was this: > > https://github.com/mflatt/guibuilder > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fmflatt%2Fguibuilder=D=1=AFQjCNHnbO_aZsxDE5ECeocU8Sf2_YYFYA> > > This seems really promising. > > Also, I didn't know about the plot library and its interactive snips. So > I'll look more deeply at that too. > > Thanks! > > --Stephen > > On Saturday, December 30, 2017 at 5:31:28 PM UTC-8, spdegabrielle wrote: >> >> Hi Stephen, >> >> I'm assuming you meant something like Snap (http://snap.berkeley.edu) in >> Dr Racket? >> >> Snips are powerful; they can inserted in text and pasteboard editors; >> they can be dynamic(e.g. plot), and they can contain other editors(text or >> pasteboard). >> >> The only possibly related prior work I’m aware of was an insert-gui >> functionality in DrRacket (maybe even DrScheme?) which allowed you to >> insert GUI elements into program text. >> >> There was a query about 'Extending DrRacket with non-text tabs' that >> might be helpful (see >> https://groups.google.com/d/msg/racket-users/Iu2XtxNX_Kk/SiavnnkYDEoJ) >> >> The DrRacket plugins documentation has a example of extending DrRacket >> https://docs.racket-lang.org/tools/implementing-tools.html >> >> Kind regards, >> Stephen D >> >> some documentation links: >> * DrRacket Plugins: http://docs.racket-lang.org/tools/index.html >> >> * Graphical Interface Toolkit: http://docs.racket-lang.org/gui/ >> * Pasteboard(editor): >> http://docs.racket-lang.org/gui/pasteboard_.html >> >> >> On Thu, 28 Dec 2017 at 04:30, Stephen Foster <ste...@thoughtstem.com> >> wrote: >> >>> If I wanted to build a drag-and-drop, visual programming interface for >>> programming in DrRacket, is there any prior work I can build on? Ideally, >>> I'd like to implement this as a DrRacket "snip", so that my students can >>> make programs that are partially text-based and partially visual. Any >>> suggestions? Has anyone done something in the ballpark? >>> >>> -- >>> 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...@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.
Re: [racket-users] where does DrRacket get its environment variables on OS X?
> Maybe DrRacket should let you configure environment variables for a program in the same way that it lets you provide command-line arguments Yes. Please. Although just like command line arguments I could see this being a thing I want to change on a per-program basis, so I guess that's a point against it. :/ ~Leif Andersen On Wed, Nov 8, 2017 at 2:51 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > At Wed, 8 Nov 2017 10:55:13 -0800, Matthew Butterick wrote: >> >> > On Nov 8, 2017, at 9:17 AM, Matthew Flatt <mfl...@cs.utah.edu> wrote: >> > >> > DrRacket tries not to interfere with programs in a detectable way. >> >> Hmm ... so if DrRacket adopts a different set of environment variables from >> command-line `racket` — which I assume is the correct and just policy — isn't >> that naturally going to lead to detectable differences, for a program that >> depends on those variables? > > As others have said, both `racket` and `DrRacket` just accept the > environment variables that the environment gives them, and Finder and > bash set up different environments. > >> > Is there something more general that you want to test for DrRacket --- >> > some effect on the execution environment that might be due to DrRacket >> > or some other tool/configuration? If so, it could make sense to set up >> > some way of communicating that to a program. >> >> In this case I was trying to configure a web servlet to run in differently >> when launched from DrRacket (in terms of its port and servlet-path) to better >> approximate Apache / htaccess conditions that exist on the live web server. > > I wonder whether a submodule is a better approach here. DrRacket > implicitly runs a `test` submodule, while `racket` doesn't, and you > could add more submodules to the list in DrRacket. But that approach > doesn't work if the conditional adjustment goes in a library, instead > of the main module. > > Maybe DrRacket should let you configure environment variables for a > program in the same way that it lets you provide command-line > arguments, and maybe it does make sense to have a default environment > variable that means "running in development mode". > > -- > 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.
Re: [racket-users] where does DrRacket get its environment variables on OS X?
> Hmm ... so if DrRacket adopts a different set of environment variables from > command-line `racket` —... It actually doesn't. This is just because you are opening it with macos's application framework...thingy On the other hand, if you run drracket directly from the command line (by running the `/bin/drracket`), you will notice that you get the same environment variables that you do with command line racket. The moral of the story is that you can detect different environment variables that your OS gives you when you start the process, but that does not really correspond to if you are running in DrRacket or command line racket. ~Leif Andersen On Wed, Nov 8, 2017 at 1:55 PM, Matthew Butterick <m...@mbtype.com> wrote: > > On Nov 8, 2017, at 9:17 AM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > > DrRacket tries not to interfere with programs in a detectable way. > > > Hmm ... so if DrRacket adopts a different set of environment variables from > command-line `racket` — which I assume is the correct and just policy — > isn't that naturally going to lead to detectable differences, for a program > that depends on those variables? > > For instance, it seems odd that DrRacket agrees with `racket` on #"USER" and > #"LOGNAME" being #"MB", but #"PATH" is totally different. > > In DrRacket it's #"/usr/bin:/bin:/usr/sbin:/sbin", but I don't know where > that comes from. > > Moreover, suppose I had a racket shell script that depended on my user > "PATH". I don't see how I could test that program in DrRacket without > dropping a `(putenv PATH "my_user_path")` at the top. > > > On Nov 8, 2017, at 8:48 AM, John Clements <cleme...@brinckerhoff.org> wrote: > > IIRC, Mac has an apologetic moue towards unix-y things here: I believe > there’s a special place in your home directory … or maybe it’s in > ~/Library/Preferences, which would … > > https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x#588442 > > > We are in a maze of twisty little passages, all alike. > > > > Is there something more general that you want to test for DrRacket --- > some effect on the execution environment that might be due to DrRacket > or some other tool/configuration? If so, it could make sense to set up > some way of communicating that to a program. > > > In this case I was trying to configure a web servlet to run in differently > when launched from DrRacket (in terms of its port and servlet-path) to > better approximate Apache / htaccess conditions that exist on the live web > server. > > > -- > 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.
Re: [racket-users] (racketcon 2017) Is there a shuttle from the hotel?
Okay thanks. For future reference, that is actually a very long distance for many people in wheelchairs. Do you know if there are any hotels closer to the conference venue? ~Leif Andersen On Mon, Sep 11, 2017 at 8:53 PM, Vincent St-Amour <stamo...@eecs.northwestern.edu> wrote: > Google maps predicts 14 minutes. > > https://www.google.com/maps/dir/Hotel+Deca,+4507+Brooklyn+Ave+NE,+Seattle,+WA+98105/Mary+Gates+Hall,+1851+NE+Grant+Ln,+Seattle,+WA+98105/@47.6582455,-122.3156366,16z/data=!3m1!4b1!4m14!4m13!1m5!1m1!1s0x5490148ac590c9fd:0x5ca09aa87f1f39cd!2m2!1d-122.3145465!2d47.6615196!1m5!1m1!1s0x549014f2ab81c35f:0x6dda64382ddc87a4!2m2!1d-122.3079505!2d47.6549716!3e2 > > Vincent > > > On Mon, 11 Sep 2017 17:33:20 -0500, > Leif Andersen wrote: >> >> How short of a walk? >> >> I ask because there is about a 30% chance my partner (who is wheel >> chair bound) will be going. >> >> ~Leif Andersen >> >> >> On Mon, Sep 11, 2017 at 2:19 PM, Vincent St-Amour >> <stamo...@eecs.northwestern.edu> wrote: >> > Hi Dave, >> > >> > We're not planning a shuttle; the hotel is a short walk from the venue. >> > >> > If that's an issue for you, please do let us know. >> > >> > Vincent >> > >> > >> > >> > On Mon, 11 Sep 2017 10:35:02 -0500, >> > David Storrs wrote: >> >> >> >> Hi folks, >> >> >> >> Is there a shuttle from the hotel to the venue and, if so, what times >> >> does it run? >> >> >> >> 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. >> >> -- >> 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.
Re: [racket-users] (racketcon 2017) Is there a shuttle from the hotel?
How short of a walk? I ask because there is about a 30% chance my partner (who is wheel chair bound) will be going. ~Leif Andersen On Mon, Sep 11, 2017 at 2:19 PM, Vincent St-Amour <stamo...@eecs.northwestern.edu> wrote: > Hi Dave, > > We're not planning a shuttle; the hotel is a short walk from the venue. > > If that's an issue for you, please do let us know. > > Vincent > > > > On Mon, 11 Sep 2017 10:35:02 -0500, > David Storrs wrote: >> >> Hi folks, >> >> Is there a shuttle from the hotel to the venue and, if so, what times does >> it run? >> >> 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. -- 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] GUI for ffmpeg and mrlib/terminal
(Although to be clear, slideshow-repl will show you how you can set up a repl rather than a terminal. But I suspect they will be similar in the gui-building respect.) ~Leif Andersen On Wed, Aug 30, 2017 at 2:00 PM, Leif Andersen <l...@leifandersen.net> wrote: >> Another thing you can look at is my Rackterm package[1]. > > Wow, that's nifty. :) > >> Still, I'm also interested in the original question: if I wanted an >> interactive GUI terminal in Racket, what's the best way to do it? > > Fair. Will's RacketTerm project looks like a good resource. Another > resource I think is very helpful is Matthew's `slideshow/repl` > package: https://github.com/mflatt/slideshow-repl > > Specifically, it shows you how you can make a repl text in an editor% > in a frame%. Specifically, I would recommend checking out: > > `slideshow/private/editor.rkt` in that repo. The two classes > slide:text% and repl-text% (lines 58-368) should show you how to get > started. > > The mrlib/terminal library is cool, but it hasn't been touched for 5 > or so years. > > ~Leif Andersen > > > On Wed, Aug 30, 2017 at 12:24 PM, William G Hatch <will...@hatch.uno> wrote: >> On Wed, Aug 30, 2017 at 09:57:01AM -0400, David Storrs wrote: >>> >>> Still, I'm also interested in the original question: if I wanted an >>> interactive GUI terminal in Racket, what's the best way to do it? >> >> >> Another thing you can look at is my Rackterm package[1]. It is currently an >> undocumented mess (and the first Racket project I made over a couple hundred >> lines), but it is also a reasonably compliant xterm that handles >> colors/styles, curses applications (eg. emacs and vim work fine in it), etc. >> I've always intended to clean up the parser and make it available as a >> library for applications that want to parse and use input with ANSI control >> characters in it, make the various pieces available as stable interfaces for >> embedding terminals into applications, etc. I haven't gotten around to >> doing that, but there is an unstable terminal-canvas.rkt that provides the >> terminal gui widget. >> >> [1] https://github.com/willghatch/rackterm >> >> >> -- >> 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.
Re: [racket-users] GUI for ffmpeg and mrlib/terminal
> Another thing you can look at is my Rackterm package[1]. Wow, that's nifty. :) > Still, I'm also interested in the original question: if I wanted an > interactive GUI terminal in Racket, what's the best way to do it? Fair. Will's RacketTerm project looks like a good resource. Another resource I think is very helpful is Matthew's `slideshow/repl` package: https://github.com/mflatt/slideshow-repl Specifically, it shows you how you can make a repl text in an editor% in a frame%. Specifically, I would recommend checking out: `slideshow/private/editor.rkt` in that repo. The two classes slide:text% and repl-text% (lines 58-368) should show you how to get started. The mrlib/terminal library is cool, but it hasn't been touched for 5 or so years. ~Leif Andersen On Wed, Aug 30, 2017 at 12:24 PM, William G Hatch <will...@hatch.uno> wrote: > On Wed, Aug 30, 2017 at 09:57:01AM -0400, David Storrs wrote: >> >> Still, I'm also interested in the original question: if I wanted an >> interactive GUI terminal in Racket, what's the best way to do it? > > > Another thing you can look at is my Rackterm package[1]. It is currently an > undocumented mess (and the first Racket project I made over a couple hundred > lines), but it is also a reasonably compliant xterm that handles > colors/styles, curses applications (eg. emacs and vim work fine in it), etc. > I've always intended to clean up the parser and make it available as a > library for applications that want to parse and use input with ANSI control > characters in it, make the various pieces available as stable interfaces for > embedding terminals into applications, etc. I haven't gotten around to > doing that, but there is an unstable terminal-canvas.rkt that provides the > terminal gui widget. > > [1] https://github.com/willghatch/rackterm > > > -- > 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.
Re: [racket-users] GUI for ffmpeg and mrlib/terminal
Well James, you're in luck. The short answer is, yes, yes you can. You should check out video at http://lang.video (you can follow the progress either on the blog, the twitter feed http://twitter.com/videolang , or on github itself: https://github.com/videolang/video . Alternatively, you are welcome to arrange a call with me some time so we can coordinate our efforts. The (slightly) longer answer is: you can find the (private and thus unstable) bindings here: https://github.com/videolang/video/tree/master/video/private/ffmpeg; and my (very early) prototype NLVE widgets here: https://github.com/videolang/video/blob/master/video/private/editor.rkt. In either case, contributions are absolutely welcome. Bug reports are also welcome and very helpful. I hope that helps, and feel free to ask any questions. If you are interested in creating GUIs for Video editing we should also sit down for a chat some time. (Either in person or via teleconference.) Anyway, I hope you have a lovely day. ~Leif Andersen On Tue, Aug 29, 2017 at 3:57 PM, James <jbiomant...@gmail.com> wrote: > I have been working through The Racket Graphical Interface Toolkit > documentation to learn GUI programming and I thought I would do a small but > useful project. The idea is to make a simple GUI front end which will > formulate commands for ffmpeg to do various video and audio conversions on > selected files and then run those commands. MrLib/terminal seems like just > the thing except there are various ways that it isn't as good as it could be > for this kind of project. It's mostly small things, for example, the cancel > button is labeled "Abort Instillation" by default. The one thing which is > not so simple is that it looks like it is intended to just run one command > and not create an interactive environment. I was expecting to be able to > send commands to the terminal% object in order to run things one after > another. Instead, you pass a function as a parameter when you create the > terminal% object and it just runs that function. So, either I have to close > the terminal and open a new one each time I run a command or I suppose that I > could have the function work with a thread mailbox or channels so that I > could keep using it. My question is whether MrLib Terminal the best option > for this kind of work or is there a better bet? > > https://docs.racket-lang.org/mrlib/Terminal_Window.html > > James > > -- > 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.
Re: [racket-users] Understanding compilation costs and creating persistent values
> Will any of the above items be compiled away? To answer your first question, I would recommend taking a look at the optimization coach. It can help you figure out what code was inlined away and what wasn't. You can find it in: View -> Show Optimization coach > How many times will each thing be expanded and compiled -- is bar defined and > compiled five separate times, only once, or not at all? Even if `bar` is not inlined, it will still only be compiled once. However, it will close over 5 different sets of variables (containing num, size, etc.) > Is there a simple way to achieve the same thing in Racket? Yes there is. Although I must state that if you find yourself doing this, stop, and rethink things, because more often then not there is a simpler way to write your code. However, if this is one of the rare cases where `state` variables (so to speak) are needed, I find using `(let () ...)` blocks to be helpful. Take the following code: (define inc (let () (define x 0) (lambda () (set! x (+ x 1)) x))) Here, `inc` is a function that takes no arguments, but has a so-called `state` variable that increments with each call. > (inc) 1 > (inc) 2 > (inc) 3 ... Again, when you find yourself doing that, I strongly recommend stopping and rethinking your solution. Hope that helps. ~Leif Andersen On Thu, Jul 20, 2017 at 1:32 PM, David Storrs <david.sto...@gmail.com> wrote: > Given this code: > > (define (foo) >(define num (+ 1 1)); result > of a function that is program-local >(define size (file-size "/some/path")) ; result of a > function that touches the disk, but result never used >(define other-size (file-size "/some/other/path")) ; result of function > that touches disk, result is used >(displayln other-size) >(define x 7) ; > binding of constant value, binding is never used >(define (bar) ; > binding of function, function is never used >(displayln "bar")) >#t) > > (for ((i 5)) > (foo)) > > Will any of the above items be compiled away? How many times will each > thing be expanded and compiled -- is bar defined and compiled five separate > times, only once, or not at all? > > > Separate but related question: > > Perl has the 'state' declaration, which says "Declare this as a local > variable, but keep it around with its value preserved after you exit the > function." For example: > > sub foo { state $x = 0; say $x++; } > # $x is not visible in this scope > foo(); > foo(); > foo(); > > > Output: > 0 > 1 > 2 > > Is there a simple way to achieve the same thing in Racket? > > -- > 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] Package Catalog License
I noticed that there is not TOS or EULA when you sign up for the package catalog. Is there actually some licensing agreement we have between the maintainers of the package server and the community members that put packages there? If not, we really should have one. Otherwise we are opening ourselves up to a large amount of legal trouble. Like what do _we_ have the right to do with packages posted there. (For example, can we make backup copies, can we make test builds, etc.) What do people downloading them have the right to do? If the author doesn't put a license on their package what rights are implicitly granted? What is our policy in case a user posts copyrighted material. etc. [1] If we _do_ have a license or TOS users agree to, we should have a link to it on the front page, or on the sign up page (or both). ~Leif Andersen [1]: I know the answers to most of these questions are obvious to us. i.e. Users have the right to look at the packages, and download them via the `raco` tool. They can also distribute therm under whatever license the package is released under (if any). If someone posts material they don't have the right to post we reserve the right to remove it, etc. etc. However, it is (sadly) important to have this in writing to protect ourselves legally. -- 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] RacketCon Code of Conduct
programming languages ~Leif Andersen On Tue, Jun 20, 2017 at 12:08 PM, Hendrik Boom <hend...@topoi.pooq.com> wrote: > On Mon, Jun 19, 2017 at 08:02:44PM -0400, Neil Van Dyke wrote: > > One, > > relatively light, example: many people assume that everyone at a > conference > > doesn't mind being photographed and tagged in Facebook and such, but I've > > heard from a few PL people who absolutely do mind, to the point that > they've > > avoided some events for that reason. > > What does PL mean? > > -- hendrik > > -- > 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.
Re: [racket-users] RacketCon Code of Conduct
I agree with Matthias here, this mailing list should absolutely remain civil. I want to thank everyone for their feedback so far. It seems we have reached a fix point as to what the community wants wrt a CoC. I am inclined to that at this point we should hand it off to the main RacketCon organizers and let them decide what to do. (They are running the show after all.) I would be happy to do the technical work of submitting a PR to the website, but I will leave it to one of the organizers to decide if they want to merge it or not. Thank you again for your input. ~Leif Andersen On Tue, Jun 20, 2017 at 8:05 AM, Mark Wunsch <m...@markwunsch.com> wrote: > In an attempt to be more "scientific" about this I would point to the > writing and actions of some other prominent language communities, as they > have made the argument FOR having a CoC much better than I could. Before > that, I think we (as practitioners and members of a technical community) > should accept that the reports of harassment, exclusion, and even assault > are startling and far more numerous then any of us should feel comfortable > with. > > The Python Software Foundation requires a CoC for all Conference grants: > http://pyfound.blogspot.com/2012/12/psf-moves-to-require- > code-of-conduct.html > Jacob Kaplan-Moss, of the Python community, writes quite well on the > subject: https://jacobian.org/writing/codes-of-conduct/ > See also, Mikeal Rogers of the NodeJS community: > https://medium.com/node-js-javascript/codes-of-conduct-82ab2d88112d > The Scala CoC: https://www.scala-lang.org/conduct.html > The Clojure/conj CoC: http://2016.clojure-conj.org/policies/ > The Rust CoC: https://www.rust-lang.org/en-US/conduct.html > > One question that comes to mind is "Does the Racket community believe it > is immune from the issues that these other communities believe should be > addressed, and if so why?" Scientific communities have long embraced codes > of ethics and conduct (see: https://www.acm.org/about-acm/ > acm-code-of-ethics-and-professional-conduct). Consider that a Code of > Conduct is a mechanism that explicitly articulates those things that the > Racket community leaders might see as implicit to making the community > successful. > > Finally, Ashe Dryden has an extensive FAQ around Codes of Conduct: > https://www.ashedryden.com/blog/codes-of-conduct-101-faq > > -- > 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] RacketCon Code of Conduct
RacketCon 2017 should have a code of conduct, as pointed out by Claire on twitter [1], and I absolutely agree. It doesn't have to be anything fancy, and can be a fairly standard one. Although we are not co-located with Strange Loop this year, they have a fairly sensible one that we could use [2], which is adapted from the one from the geek feminism wiki [3]. Does anyone have any opinions on what we use? I would also be happy to add it to the RacketCon web page. [1]: https://twitter.com/chckadee/status/874345544977707008 [2]: https://www.thestrangeloop.com/policies.html [3]: https://geekfeminism.org/about/code-of-conduct/ ~Leif Andersen -- 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] Wanted: Easier way to contribute docs
> A lot of sites show a hyperlink icon (two chain links typically) when you > mouse over a section title. We could do that along with an edit icon instead > of requiring users click the section header. That would be more discoverable > and more in line with what other sites like Github do IMO. I'm not opposed to that, but I don't really have the cycles to figure out how to do it. ;) ~Leif Andersen On Tue, Jun 13, 2017 at 1:42 PM, Jack Firth <jackhfi...@gmail.com> wrote: >> It might also be a good idea to have the documentation generator put a >> standard sentence at the top of each page: "Click on a section header to >> find out how to link to it or edit it." > > A lot of sites show a hyperlink icon (two chain links typically) when you > mouse over a section title. We could do that along with an edit icon instead > of requiring users click the section header. That would be more discoverable > and more in line with what other sites like Github do IMO. -- 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] Wanted: Easier way to contribute docs
When you click on a section title, something like this pops up: Link to this section with @secref["sync" #:doc '(lib "scribblings/reference/reference.scrbl")] Would it be sufficient to also have: Edit this section at: I know its not ideal, but this seems like the easiest possible way to go about it. ~Leif Andersen On Tue, Jun 13, 2017 at 9:34 AM, David Storrs <david.sto...@gmail.com> wrote: > I've mentioned this on list before but wanted to bump it: > > It is too difficult to contribute to the Racket docs. There needs to be an > easy and obvious way to edit the pages at docs.racket-lang.org or an easy > and obvious way to go from the page to the relevant part of the GitHub > repository. > > I have this experience frequently: > > 1) Read through docs, find something that seems incomplete or difficult to > comprehend, want to contribute a refinement. > > 2) Realize I don't remember how to do that. The answer was provided on the > list when I asked about it months (a year?) ago, but it involved something > like "click section title to get scribble reference, load github page for > Racket, click correct github racket repository, navigate to part of repos > that corresponds to the scribble reference, click the pencil icon, write > contribution, do...something? in order to send pull request." > > 3) Debate for a moment if I want to (a) dig through the list to find the > answer and then execute it or (b) continue making progress on my task for > work. > > 4) Continue making progress on my task for work. > > > The immediate answer is that I should write down the 'how to contribute' > answer in an easily-referencable form on my local machine or else keep a > bookmark to the answer. > > The better answer would be that there is a link at the top of each section > (each function?) that will take me to the corresponding file in the GitHub > repository. > > The best answer is that I would be able to edit the docs inline and the > changes would then be packaged up as a pull request and sent to git. > Creating this version is almost certainly too much work for anything run by > volunteers. > > > For the record, the thing that brought this to mind is that I found myself > wanting 'slice', realized that it wasn't in the Lists docs, googled, found > that it might be under Sequences [it isn't for Racket but is for other > Lisps], wanted to add a link on the Lists page saying "incidentally, lists > are sequences so you should also check out those for additional > functionality." > > > > -- > 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] Re: Running Racket on Windows 10 Creative Update
Woops, I sent the wrong URL, here is the correct one. http://prl.ccs.neu.edu/blog/2017/05/26/racket-6-9-and-windows-10-creative-update/ ~Leif Andersen On Fri, May 26, 2017 at 8:38 PM, Leif Andersen <l...@leifandersen.net> wrote: > Some users have been reporting that DrRacket crashes Windows 10 > Creative Update [1] This is bad for classes that use DrRacket. To help > students with Windows 10 Creative Update, I have prepared a virtual > machine that comes pre-bundled with DrRacket. You can find that > machine here: > > http://prl.ccs.neu.edu/blog/2017/05/26/racket-4-9-and-windows-10-creative-update/ > > ~Leif Andersen > > [1]: https://github.com/racket/racket/issues/1671 -- 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] Running Racket on Windows 10 Creative Update
Some users have been reporting that DrRacket crashes Windows 10 Creative Update [1] This is bad for classes that use DrRacket. To help students with Windows 10 Creative Update, I have prepared a virtual machine that comes pre-bundled with DrRacket. You can find that machine here: http://prl.ccs.neu.edu/blog/2017/05/26/racket-4-9-and-windows-10-creative-update/ ~Leif Andersen [1]: https://github.com/racket/racket/issues/1671 -- 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] DrRacket Accessibility with Screen readers
Hello Erika. I have low vision and have had better luck using screen magnifiers with DrRacket than screen readers. With that being said, I honestly don't have much experience with JAWS. Although I take it that means you do want to use Windows screen readers with DrRacket, is this correct? ~Leif Andersen On Fri, Apr 28, 2017 at 1:07 PM, Erika Thompson <erikameganthomp...@gmail.com> wrote: > We're using DrRacket in an online course on edX, How to Code. We've had a > student enquire about using a screen reader with DrRacket. Does anyone know > anything about DrRacket's compatibility with screen readers, such as Jaws. > Thanks so much > > -- > 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.
Re: [racket-users] Racket/Dr. Racket on Android?
I should point out that the current racket-android project does not currently support most of the Android APIs that developers are used to, and instead offers an OpenGL ES context. This is because the android-ndk does not have those APIs (unlike the sdk.) FWIW, if you do want them, there are C wrappers you can use, and then you can use the FFI to use those. Although I have no idea what the speed would be, probably slow though. ~Leif Andersen On Thu, Apr 20, 2017 at 1:35 PM, Jay McCarthy <jay.mccar...@gmail.com> wrote: > I interpret the question as, "Can I download something, write Racket > programs on my tablet, and run them?" > > The answer to that is "No". > > Instead, "racket-android" lets you write an Android app in Racket. > > Jay > > On Thu, Apr 20, 2017 at 1:10 PM, Vincent St-Amour > <stamo...@eecs.northwestern.edu> wrote: >> There is! Thanks to Jay McCarthy, Byron Davies, and Black Swan Learning LLC. >> >> https://github.com/jeapostrophe/racket-android >> >> Vincent >> >> >> On Thu, 20 Apr 2017 11:30:55 -0500, >> Lawrence Bottorff wrote: >>> >>> Is there a version of Racket for Android yet? >>> >>> -- >>> 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. > > > > -- > -=[ Jay McCarthy http://jeapostrophe.github.io]=- > -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=- > -=[ Moses 1:33: And worlds without number have I created; ]=- > > -- > 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.
Re: [racket-users] Scribbling documentation for a module beginning with _
Oooh...that is an interesting case. FWIW, you could always cheat, and have the docs use a different name for the module for defmodule's, and manually typeset the correct name out. Its kind of a kludge though: ``` @defmodule[@racketmodfont{_-exp} #:module-paths (secret_-exp) #:lang] @racketmodlink[secret_-exp]{_-exp} ``` This also has the major downside that anyone else wanting to link to your module will have to know the `secret_-exp` name you chose. I guess that _could_ be worked around by making helper functions for them, but that seems kind of silly to me. ~Leif Andersen On Thu, Apr 13, 2017 at 8:44 PM, Philip McGrath <phi...@philipmcgrath.com> wrote: > I'm trying to write documentation for a module named _-exp, and I'm running > into a problem because (I think) of the way underscores are treated by > racketblock. > > Using @defmodule[_-exp #:lang] or @racketmodname[_-exp] typesets the name as > -exp . > > I can work around this for defmodule by doing > > @defmodule[@racketmodfont{_-exp} >#:module-paths (_-exp) >#:lang] > > but I haven't found a solution for linking to the definition. I'm currently > trying @racketmodlink[_-exp @racketmodfont["_-exp"]], but this causes raco > setup to complain: > > WARNING: undefined tag in /_-exp/scribblings/_-exp.scrbl: > raco setup: (mod-path "_-exp") > > and indeed the link does not work. > > In my local documentation search results, _-exp language shows up as > expected, so I think the problem is with the link, not the definition, but > I'm not sure how to fix this. > > Philip > > -- > 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.
Re: [racket-users] Package layout in docs
So, I really don't care how it work. Logo is fine, seperate website is fine. Checkboxes that lets users say what packages come in are fine. Yelp reviews are fine (although if we go down that route can we also add Edit buttons. ;) ) My only concern is that at the moment, anyone can publish something that very much looks and feels like it was either done by, or supported by, PLT Design Inc. Which is a potentially dangerous thing. All of the above solutions y'all suggested solve that issue. ;) (Oh also Matthew, I completely agree with you. There are some pretty awesome community built packages which I like way more than the one in the core distribution.) ~Leif Andersen On Mon, Jan 30, 2017 at 5:02 PM, Dupéron Georges <jahvascriptman...@gmail.com> wrote: > Le lundi 30 janvier 2017 22:13:57 UTC+1, Matthew Butterick a écrit : >> Recently we added a Racket logo to the upper right of the public doc pages. >> We could do something where this logo changed depending on whether the >> package belonged to core or community or whatever. Then we wouldn't need to >> actually cleave the docs into two websites (which IMO is counterproductive). > > I agree with Matthew Butterick that splitting the docs into two websites > would be counterproductive. As a user, I don't want to have to remember > whether this package happens to be in main-distribution or not, and look up > one website or the other. The same applies when searching for a > functionality: I would rather avoid having to search on two different > websites. > > The logo idea seems like a nice compromise. > > Another possibility would be to change the packages so that they display > somewhere below the title "Part of the community package foo", "Part of the > main Racket distribution" or "Part of the minimal Racket distribution". As > far as I can tell, this would require cooperation from the packages > (modifying the scribble files), unless Scribble forcefully inserts the text > (like the "v.6.8" above the title). -- 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] Package layout in docs
FWIW, I have to support Ethan here. (At least a little bit). I really how user installed packages (and collections) in Racket feel like first class citizens. Its very nice, both that its rewarding when I make a new package, but also in terms of searching for documentation and whatnot. However, there is something to be said about having them show up as results on the _official docs_ on our webpage. Anyone can upload a package to pkgs.racket-lang.org and, provided that it compiles, we'll display the content on our webpage as if it was a first class thing. While we have a sandbox to prevent certain classes of technical malicious attacks we don't really have much in place (other than the community) for social engineering based attacks. For example, I could make a package that looks normal, acts normal, and most of the docs are normal, but in the docs it links to some malicious page, or has misleading content. Well, now we just not only gave this package a platform, but we gave it a platform that looks like we 100% endorse it, because its mixed seamlessly in with the API that ships with the core distribution. I don't think that the solution is to make core packages first class, and community ones second class. That looses the spirit of what we're going for here. But maybe we could have in our documentation a way for users to select what packages they want to show up in search results. That way all packages are equal here, and a person who wants to, say, only use core packages, can get that. An alternative approach which probably takes less effort is to just have two documentation pages. One for core packages, and one for community packages. Obviously we should still make 3rd party packages feel like first class build in stuff, but if we just host them at a different URL, that might be enough to keep things clear. just some thoughts anyway. ~Leif Andersen On Sun, Jan 29, 2017 at 3:48 PM, Ethan Estrada <ethan.estr...@gmail.com> wrote: > Curse my sausage fingers! That last send was unintentional. I've deleted > it from the online Google Groups forum for the sake of future subscribers. > > I can understand wanting to minimize the distinction and in some ways make > all core language, standard libraries, and community libraries equal. > > For me the issue is software maintenance. If I'm building something that > needs functionality from an external library, I'm more likely to choose a > library from the standard install if one exists. I can be reasonably > certain it will be supported for a long time into the future, and if it > ever ceases to be supported it will likely be gracefully deprecated over > the course of a few releases. Neither of those points are guaranteed, but I > think they are reasonable assumptions to make. > > Also, to some extent there already is a distinction in the documentation. > There is the section "Racket Language and Core Libraries", and then there > is everything else. However, the libraries from the 'base' package and > other shipped packages are sprinkled into the "everything else" docs and > not all the shipped packages are listed under "Racket Language and Core > Libraries". So it makes things murky. > > A possible compromise may be to have the top level page of http:// > docs.racket-lang.org/ remain the same, but have a small link/page under > http://docs.racket-lang.org/reference/ page that lists the links to all > the packages/libraries/collections that are shipped by default with Racket. > The pages that the links point to would all still live where they always > have and still be listed at the top level http://docs.racket-lang.org/ > the same way they already are. That way there is some centralized place to > figure out what ships with racket without mucking around the filesystem > after install, or checking on each link on http://docs.racket-lang.org/ > to see if the package it requires from is 'base' or something else core to > the install. > > To Stephen, thanks for sharing the articles from Eric Raymond. It made me > think maybe I'm not just a crazy guy on the street corner wearing a burlap > sack and a tin foil hat declaring the end of the world. Or, at the very > least, I'm not alone on the street corner :) . > > -- > Ethan Estrada > > On Jan 29, 2017 06:45, "Matthew Flatt" <mfl...@cs.utah.edu> wrote: > > At Sat, 28 Jan 2017 22:51:43 -0800 (PST), Ethan Estrada wrote: > > My only real beef with the Racket docs are the layout of packages; > > there is no clear distinction between docs for standard library items > > and docs for community provided libs. > > That's intentional. I'd say that the absence of a line that > distinguishes "Racket" from "not Racket" at the package level is an > extrapolation of our goal to avoid a line
Re: [racket-users] Stickers!
yaa.Although thanks to Matthew Butterick we have a logo that doesn't look quite so much like the pepsi logo any more. ^.^ (Also since pepsi is in a completely different domain I think that would make things more tricky too...) Also, ya, I think you're right Neil. ~Leif Andersen On Fri, Jan 27, 2017 at 3:08 PM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > Pepsi did! > > ;) > > Robby > > On Fri, Jan 27, 2017 at 2:01 PM Neil Van Dyke <n...@neilvandyke.org> > wrote: > >> Leif Andersen wrote on 01/27/2017 02:45 PM: >> > Do we actually have a trademark on the Racket logo? >> >> I believe PLT can claim trademarks on the logo and the name (without >> registration costs -- the "tm" rather than the circle-R), and then just >> needs to police a tiny bit, to keep it from falling into the public >> domain. Well-defensible claim to the name might already be lost, but if >> there is a desire to protect the logo for some reason, maybe pro bono >> legal advice about how to do that could be gotten. But keep it off >> PepsiCo's radar. >> >> Realistically, I don't expect anyone will make money off appropriating >> Racket branding anytime soon. I would be very happy if they could. >> >> -- >> 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.
Re: [racket-users] Stickers!
Do we actually have a trademark on the Racket logo? ~Leif Andersen On Fri, Jan 27, 2017 at 2:44 PM, Ben Greenman <benjaminlgreen...@gmail.com> wrote: > In my unprofessional opinion: > - don't modify the logo (change colors, stretch, add unrelated text) > - don't use the logo for personal profit > - don't use the logo in politics > and you should be fine. > > On Fri, Jan 27, 2017 at 3:39 AM, Daniel Brunner <dan...@dbrunner.de> > wrote: > >> Hi, >> >> that's a great idea. I'd like to order some at a local supplier for >> distributing them in Germany/Europe. >> >> Are there any legal issues to consider? (I did not find anything in the >> documentation.) >> >> Kind regards, >> Daniel >> >> Am 24.01.2017 um 22:15 schrieb Ben Greenman: >> > Hi Racket Users, >> > >> > I ordered a bunch of Racket stickers to celebrate the 6.8 release. >> > Here's proof: >> > http://www.ccs.neu.edu/home/types/resources/stickers.jpg >> > >> > If you send me your address, I will mail you some stickers. For free!* >> > >> > I'm thinking 4 stickers per request (2 rectangles, 2 circles), but if >> > you live outside the US and promise to serve as a "volunteer regional >> > sticker distributor" then I'll send more.** >> > >> > Peace, Love, and Racket, >> > Ben >> > >> > >> > * While supplies last. And if you want un-free stickers, you can make >> > your own on stickermule.com <http://stickermule.com> or send a donation >> > to RacketCon 2017. >> > >> > ** While supplies last, and subject to the internal dimensions of the >> > cheapest padded envelope at my local US post office. >> > >> > -- >> > 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 >> > <mailto: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. >> > > -- > 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.
Re: [racket-users] Mann-Whitney test?
You _could_ use the FFI, but you'd have to use the Racket FFI to go to C, and then use R's FFI to go to C, and then coerce all of R's data to Racket and all of Racket's data back to R. Because of this (provided no one makes a #lang R first ;) ), I think it would be easier to just spawn up a new R process using something like system* or process, and use pipes to send data back and forth directly. Yes, all of the data would need to be serialized into streams, but you would do an analogous process going from R to C to Racket. ~Leif Andersen On Sun, Jan 22, 2017 at 12:19 AM, James <jbiomant...@gmail.com> wrote: > > > Does anybody have an implementation of the Mann-Whitney U test (or the > equivalent Wilcoxson Rank test) in Racket? I imagine I could easily hack > up my own, but somebody else may have done a better job of it already. > > I see that no one has answered this question yet. This is something which > I would do and have done in R. So this brings me to a question I was going > to ask anyway which is how to do multi-language development including > Racket and R. Would it be FFI from Racket to R? I already have a body of > R code of my own which I would like to be able to call from Racket. The > general idea is that It would be an application where things like the GUI > and networking elements are done in Racket but computations are done in R. > > James > > -- > 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] Bugs in the Racket Bytecode Versifier (as of 6.7)
Hey all, I noticed that the following program fails to run, but only after its been compiled (on 6.7, 6.6 and earlier don't seem to have this issue): https://gist.github.com/LeifAndersen/dfad9a8f55ef671e4f3aa41b321ef7bf #lang racket/base ;; ill-formed.rkt (define ill (let ((base (string-append "a"))) (λ () base))) (ill) To get the error, run: $ raco make ill-formed.rkt $ racket ill-formed.rkt ?? 0 compiled/ill-formed_rkt.zo::369: read (compiled): ill-formed code [../../../racket/gc2/../src/validate.c:1426] context...: standard-module-name-resolver This error doesn't seem to happen if `string-append` is replaced with various other functions that create strings (or just string literals), and it seems to go away if the function is inlined. I'm not entirely sure what's causing this bug yet, but it appears to either be a bug in the versifier, or a new optimization. Has anyone else seen something like this recently? (If not I'll update the list once I get a sense as to what is going on.) ~Leif Andersen -- 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] DrRacket's XML Boxes not hygenic
I noticed today that DrRacket's XML boxes are not hygenic Lets say I have: ``` #lang racket (define x [[]]) ``` (where [[ ]] denotes the text of an xml box) X will be, as expected: ``` '(hello ()) ``` However, if we redefine quasiquote at the top of the file: ``` #lang racket (define-syntax (quasiquote stx) #'42) (define x [[]]) ``` Now x is equal to 42. I know in general that the quasiquote symbol (`) is not hygenic, but this does not apply here. When you look at the implementation of these boxes the thing that the reader converts them to is: ``` (list 'quasiquote clean-xexpr ``` Where `clean-xexpr` is the xml converted to an xexpr. So, the problem is not the use of the (`) symbol, but the fact that this function is evaluating to an s-expression rather than a syntax object. Understandably, if you return a syntax object: #`(quasiquote #,clean-xexpr), the macro expander will complain about ambiguous scopes. But, in general, is there a way to say we would like quasiquote to be bound to the definition in the module defining XML boxes, rather than whatever one the module using an XML box happens to have? Thank you. ~Leif Andersen -- 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] Well typed classes do go wrong
Specifically, if you use a field inside of a require/typed. Consider the following code: #lang racket (module mod-a racket (provide A%) (define A% (class object% (super-new) (field [state 0] (module mod-b typed/racket (require/typed (submod ".." mod-a) [A% (Class (field [state (Vectorof String)]))]) (define B% (class A% (super-new) (inherit-field state) (: foo (-> (Vectorof String))) (define/public (foo) state))) (define b (new B%)) (vector-ref (send b foo) 0)) (require 'mod-b) If you run it, racket will segfault. Because typed racket thinks that the output of `foo` is safe (as it does typecheck), but the `require/typed` is incorrect, and apparently doesn't get the correct contract. You can also see a similar issue in this code: #lang racket (module mod-a racket (provide A%) (define A% (class object% (super-new) (define/public (foo) "hello") (define/public (bar) ;; TRY REPLACING WITH `(send this foo)`!!! (foo) (module mod-b typed/racket (require/typed (submod ".." mod-a) [A% (Class [foo (-> Integer)] [bar (-> String)])]) (define B% (class A% (super-new) ;; TRY COMMENTING OUT THIS METHOD!!! (define/override (foo) 42))) (define b (new B%)) (send b bar)) (require 'mod-b) The code here fails, as expected, because foo returns an integer. But, if you comment out the (define/override (foo) 42) It actually works because (foo) now returns a string: `"hello"`. This would make sense if the call to `foo` was static, but its dynamic. This can be seen by replacing bar's implementation (in mod-a) with: (define/public (bar) (send this foo) Then `foo` now throws a contract error because, as expected, it returned a String rather than the Integer require/typed expected. In both cases, even though we are using dynamic dispatch, one case gets a contract wrapper and the other doesn't. At best, this seems inconsistent. And at worst, this seems very unsound and can lead to unpredictable behavior (like the segfault above). Thoughts? Thank you ~Leif Andersen -- 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] Fix Ctr+F search on the new website?
> (For instance, Chrome on Mac OS does not have this problem.) Really? I get the same problem on Chrome on Mac OS. That's bizarre. Namely, chrome 55.0.2883.95, and OS X El Capitan. I also get it with Firefox 50.1 on OS X El Capitan I have not tried it anywhere else. > What are you doing on the Racket home page anyhow? ;) Tee hee. Well, in that specific instance I was helping someone find the mailing list page. But since I'm nearly blind I like to test our stuff for accessibility concerns. ~Leif Andersen On Thu, Dec 29, 2016 at 12:29 PM, Matthew Butterick <m...@mbtype.com> wrote: > > On Dec 28, 2016, at 6:18 AM, Leif Andersen <l...@leifandersen.net> wrote: > > I noticed that Ctr+F based searching is kind of uncomfortable on the new > website. Namely, if I am searching for a word that is located below one of > the images, it gets highlighted like you would expect, but the image > doesn't actually disappear. Thus I need to play whack-a-mole to find the > highlighted text myself. > > Instead, would it be possible to have the image disappear when the > relevant text is highlighted? > > > It's helpful to me if reports like this include browser / OS details, as > they don't all behave the same way. (For instance, Chrome on Mac OS does > not have this problem.) > > As Georges said, I don't know of any way to reveal-as-you-search. > > I think I can change it so the hover-box text doesn't show up in the > search results* though I'm not sure that would necessarily be an > improvement. > > What are you doing on the Racket home page anyhow? ;) > > * a div set to "display: none" will not be searched > -- 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] Fix Ctr+F search on the new website?
Hey all, I noticed that Ctr+F based searching is kind of uncomfortable on the new website. Namely, if I am searching for a word that is located below one of the images, it gets highlighted like you would expect, but the image doesn't actually disappear. Thus I need to play whack-a-mole to find the highlighted text myself. Instead, would it be possible to have the image disappear when the relevant text is highlighted? Thoughts? Thanks. ~Leif Andersen -- 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] Repaint an editor<%> (when embedded in an editor-snip%) when it is copied.
I have extended a pasteboard% editor that overrides the `on-paint` method to draw a snazy background. (Also the min width and height have been set to 200.) When I put this editor in a snip using `(make-object editor-snip% (new snazy-pasteboard%))`, and insert that snip directly into drracket (via a plugin adding it to the insert menu), I see my snip with the snazy background. Unfortunately, the moment I try to run `copy` on that snip (which happens whenever the REPL prints out the snip), all I get is a small square. I made sure to override the `copy-self` and `copy-self-to` methods for my extended pasteboard%, editor, and I have even made sure that the minimum width and height are getting set when the copy happens. All of the data I would expect are still there, but the background is not drawn at all, and the original size of the snip is lost too (even though the minimum height and width fields still both say 200 when checked). Finally, I made sure to call the editor's `invalidate-bitmap-cache` in an attempt to make sure it at least got repainted, with no luck. So, I'm stumped. Does anyone have any suggestions as to why my extended editor is loosing relevant properties? If I copy a pasteboard% that has not been extended it works as expected, so it wouldn't surprise me if I forgot to override something, but I can't find any examples. Any help is appreciated, thanks. ~Leif Andersen -- 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] Re: What is the Racket equivalent to 'return' for early exit?
Honestly, I personally like to use let/ec for this. I know it's still using continuations, but it is much more lightweight, both syntactically and in terms of run-time costs. (define (do-something) (let/ec return (unless (some-condition) (return NO)) (do-the-thing))) Although honestly, with this pattern, I find that errors work better here, as they return early, and you can decide how they get handled with a with-handlers. (define (do-something) (unless (some-condition) (error "NO")) (do-the-thing)) (with-handlers ([exn:fail? (lambda (e) (displayln "I returned early"))]) (do-something)) But that is specifically because I prefer the workflow of catching errors, rather than always having to manually check the output of the function (I'm looking at you C...) Hope that helps. ~Leif Andersen On Mon, Nov 21, 2016 at 12:41 PM, David Storrs <david.sto...@gmail.com> wrote: > Edit: I know I could also use call/cc and invoke the continuation to > escape, but that still adds another layer of indentation for something that > in the normal case won't be called. > > It's not a big deal, but I was wondering about it. > > On Mon, Nov 21, 2016 at 9:37 AM, David Storrs <david.sto...@gmail.com> > wrote: > >> In Perl I would often write: >> >> sub do_something { >> return unless ( some necessary condition is met ); >> ... do the thing ... >> } >> >> In Racket I could wrap the rest of the procedure in an (if), but that >> adds an unnecessary level of indentation and feels clunky. Is there a >> clean solution? >> >> > -- > 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] (sixth RacketCon) videos up.
Hello all, The videos for RacketCon are finally up. You can watch them directly on Youtube here: https://www.youtube.com/playlist?list=PLXr4KViVC0qKSiKGO6Vz9EtxUfKPb1Ma0 You can also find slides at the RacketCon website: https://con.racket-lang.org ~Leif Andersen -- 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] #lang video
Sure. So, I should warn you that its still very unstable and very experimental. But you can find the current state of the code here: https://github.com/LeifAndersen/racket-video The render function is in render.rkt, and takes in a video object (in core.rkt). At the moment it is similar to scribble/core, and I will add the nicer syntax+other tooling once this is a bit more stable. (And after the RacketCon videos are out. ;) ) You can find some examples of how to use it in: private/examples.rkt Hope that helps, and if you have any questions let me know. ~Leif Andersen On Mon, Oct 17, 2016 at 3:52 PM, Hendrik Boom <hend...@topoi.pooq.com> wrote: > On Mon, Oct 17, 2016 at 11:49:50AM -0400, Leif Andersen wrote: > > Yes, the videos are coming along and will be out soon. > > > > It is taking a bit longer to get them out this time because I created > #lang > > video, which is a Racket based DSL for video editing, which will > hopefully > > make putting them out in future years faster. > > I'd very much like to see details on #lang video. > > -- hendrik > > -- > 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.
Re: [racket-users] Any information on whether/when Sixth RacketCon videos will be available?
Okay, so maybe I had some altimeter motives with making this DSL. Namely: 1. The existing pieces of software Asumu and I used in the past were buggy and crashed every 5 minutes. 2. We don't really have the budget to buy a video editor professionals use. (Although I could be wrong about that.) 3. I kind of wanted to see if I could do it. I mean, its not trivial. We have scribble for documents, can we do the same thing for media that isn't just text? I think so. Currently the state of the art is just an XML file passed into mlt, I think we can do better than that. ~Leif Andersen On Mon, Oct 17, 2016 at 11:56 AM, Robby Findler <ro...@eecs.northwestern.edu > wrote: > https://xkcd.com/1319/ > > ;) > > Also, check out this handy chart! https://xkcd.com/1205/ > > Robby > > On Mon, Oct 17, 2016 at 10:49 AM, Leif Andersen <l...@leifandersen.net> > wrote: > > Yes, the videos are coming along and will be out soon. > > > > It is taking a bit longer to get them out this time because I created > #lang > > video, which is a Racket based DSL for video editing, which will > hopefully > > make putting them out in future years faster. > > > > > > ~Leif Andersen > > > > On Mon, Oct 17, 2016 at 9:07 AM, Vincent St-Amour > > <stamo...@eecs.northwestern.edu> wrote: > >> > >> Hi Hashim, > >> > >> Do not fear, the videos are coming! > >> > >> They take some time to prepare, though. We need to do some > >> post-production to splice in the audio capture (the camera's audio is > >> not as good as we'd like), and splice in the screen capture (or slides, > >> when that wasn't available), to make sure viewers see everything. > >> > >> Leif (our AV expert) informs me that the videos should be out this week. > >> Leif, could you confirm? > >> > >> Vincent > >> > >> > >> > >> > >> On Mon, 17 Oct 2016 03:50:49 -0500, > >> hashim muqtadir wrote: > >> > > >> > The videos for the live streams are available on youtube but they > aren't > >> > as clear audio/video-wise as the individual talks videos are for older > >> > RacketCons are. The website does say they will be made available; I > just > >> > hope that plan did not get scrapped, did it? > >> > > >> > -- > >> > 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. > > > > > > -- > > 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.
Re: [racket-users] Any information on whether/when Sixth RacketCon videos will be available?
Yes, the videos are coming along and will be out soon. It is taking a bit longer to get them out this time because I created #lang video, which is a Racket based DSL for video editing, which will hopefully make putting them out in future years faster. ~Leif Andersen On Mon, Oct 17, 2016 at 9:07 AM, Vincent St-Amour < stamo...@eecs.northwestern.edu> wrote: > Hi Hashim, > > Do not fear, the videos are coming! > > They take some time to prepare, though. We need to do some > post-production to splice in the audio capture (the camera's audio is > not as good as we'd like), and splice in the screen capture (or slides, > when that wasn't available), to make sure viewers see everything. > > Leif (our AV expert) informs me that the videos should be out this week. > Leif, could you confirm? > > Vincent > > > > > On Mon, 17 Oct 2016 03:50:49 -0500, > hashim muqtadir wrote: > > > > The videos for the live streams are available on youtube but they aren't > as clear audio/video-wise as the individual talks videos are for older > RacketCons are. The website does say they will be made available; I just > hope that plan did not get scrapped, did it? > > > > -- > > 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. > -- 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] Scribble, Picts, and Serialize/Deserialize Oddities
I have been playing with scribble and serialize/deserialize a bit lately in a (somewhat successful) attempt to make my paper build in a reasonable amount of time. Anyway, I noticed some interesting behavior when Scribble is combined with picts and serialize/deserialize. And I'm kind of stumped as to what could cause it. Take the following file: ``` #lang scribble/manual @(require pict racket/serialize) @(define x (vc-append (filled-rectangle 30 10 #:color "yellow") (filled-rectangle 30 10 #:color "yellow"))) @x @(deserialize (serialize x)) ``` This code defines a pict made out of two yellow rectangles stacked on top of each other. It makes a document containing these two rectangles, followed by the two rectangles after they've been serialized and deserialized. Provided that `x` is serializable (which it supposedly is), I would imagine that the two pictures would look the same. Instead however, it ends up looking like this. (The PDF file is also attached). [image: Inline image 1] Note how after its been serialized and deserialized, the two rectangles, appear slightly further apart and have a doubly thick line. For what its worth, if I have DrRacket draw the pict it always shows up like the bottom rectangle. Both of these images make sense (depending on how we intemperate border), but I'm a bit confused why it would show up differently after being serialized and deserialized. Any ideas? Thank you. ~Leif Andersen -- 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. sertest.pdf Description: Adobe PDF document
Re: [racket-users] Racket apps on Android
Oh nifty, thanks for doing this Jay. Out of curiosity, have you also connected any of this up to the Android APIs so we can use Android's ListViews and whatnot? Or is it all just OpenGL, lux, etc? ~Leif Andersen On Fri, Sep 30, 2016 at 3:38 PM, Jay McCarthy <jay.mccar...@gmail.com> wrote: > On Fri, Sep 30, 2016 at 3:14 PM, Tony Garnock-Jones <to...@ccs.neu.edu> > wrote: > > On 09/29/2016 08:05 PM, Jay McCarthy wrote: > >> The build system that Byron Davies and I implemented for deploying > >> full-screen OpenGL Android apps is available here: > >> > >> https://github.com/jeapostrophe/racket-android > > > > This is great! > > > > I'm trying a build now on debian stretch. I've sent a pull request with > > the (small) Makefile changes I've made. > > > > If I use the "basic" example source code, the app builds and installs, > > but when I start it, it blanks the screen, does nothing for a few > > seconds, and then crashes with the usual unhelpful Android > > "Unfortunately, RacketAndroidProject has stopped." > > This could mean a few things... > - "basic" still uses "simulator.rkt" and not "tablet.rkt" > - The "raco ctool" uses a different version of Racket than was built for > Android > - There's another exciting error (we'll have to look at the Android logs) > > > This is on a Sony Xperia Z2 cellphone running CyanogenMod 12.1 (Android > > 5.1.1). I don't know if it supports the required OpenGL features. I also > > have no idea where to begin getting e.g. debug output or starting a > > debugger for Android. > > From Android Studio with the device attached, there's a button for > "Console" > > At the command-line, you can run the `logcat` command. > > > When I try "make simulate" from my debian build machine, a window opens, > > but I get the following output/exception repeatedly: > > > > You are using OpenGL (4 3) > > OpenGL error in procedure glUseProgram: The specified operation is not > > allowed in the current state. > > context...: > >/home/tonyg/src/racket/racket/share/pkgs/opengl/opengl/main.rkt:74:7 > > This normally means that the shaders do something your driver doesn't > support. Can you give me more info about the GPU, driver, OS, etc that > you have? > > If you open up `mode-lambda/backend/gl/util.rkt` and go to the > definition of `print-shader-log`, then you can add the following line > at the bottom of the function > > (error 'print-shader-log "Shader/program compilation/linking failed > without error message") > > If that happens, then I think I know where I go to debug some more, > but I'll need to send you more patches > > Jay > > -- > 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.
Re: [racket-users] [ANN] New package: live-free-or-die
> Also, with typed/racket/unsafe the optimizer *is* still run, so that's not any better *unless* you selectively choose what you want to be unsafe. Woops, you are absolutely correct, I meant: typed/racket/no-check ~Leif Andersen On Thu, Sep 22, 2016 at 10:27 PM, Alex Knauth <alexan...@knauth.org> wrote: > > On Sep 22, 2016, at 9:39 PM, Jay McCarthy <jay.mccar...@gmail.com> wrote: > > If I knew how, I'd do unsafe-in, but I just know how to fake a typed > context. The whole point is to use the optimizer so libraries like math are > usable. > > > Libraries like math/array would still be usable without the optimizer. > > What you really want is a version of require (or a require transformer) > that would allow untyped code to *selectively* unsafely require typed code. > I would want to import as few things unsafely as possible. > > It's impossible to choose what to be unsafe about if it's an > all-or-nothing imperative flag like that. > > On Friday, September 23, 2016, Leif Andersen <l...@leifandersen.net> > wrote: > >> Umm...if you're going to do this, why is it imperative, and not a require >> transformer? >> >> Also, I kind of agree with Matthias here...sigh. :'( Like, as far as I >> can tell, this is even worse then typed/racket/unsafe, as the optimizer is >> still run. O_o >> > > Also, with typed/racket/unsafe the optimizer *is* still run, so that's not > any better *unless* you selectively choose what you want to be unsafe. > > This is worse, but not because of the optimizer; because of the > all-or-nothing part. > > Alex Knauth > > -- 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] RacketCon: thanks!
> I wish every day could be RacketCon. Oh god...while that would be fun...the AV nightmare...we'd need a dedicated AV team to handle that... :/ ~Leif Andersen On Thu, Sep 22, 2016 at 9:08 PM, Matthew Butterick <m...@mbtype.com> wrote: > I agree. A terrific event. I wish every day could be RacketCon. > > > On Sep 21, 2016, at 2:55 PM, 'John Clements' via Racket Users < > racket-users@googlegroups.com> wrote: > > > SO glad I went to RacketCon this year. Great to meet you, great to see > you. A bunch of community members now have faces in my mind. > > > > Many thanks for all the hard work from Vincent, Leif, Matthew B., etc. > etc. etc. > > -- > 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.
Re: [racket-users] [ANN] New package: live-free-or-die
Umm...if you're going to do this, why is it imperative, and not a require transformer? Also, I kind of agree with Matthias here...sigh. :'( Like, as far as I can tell, this is even worse then typed/racket/unsafe, as the optimizer is still run. O_o ~Leif Andersen On Thu, Sep 22, 2016 at 9:16 PM, Matthew Butterick <m...@mbtype.com> wrote: > On Sep 22, 2016, at 9:23 AM, Matthias Felleisen <matth...@ccs.neu.edu> > wrote: > > > I checked the calendar, because I thought I had gone into hibernation > > and woken up on April Fool’s day. > > > Those of us who have lived in New Hampshire take this matter quite > seriously. > > We've also learned to endure the teasing of people who live in > Taxachusetts. > > I raise a butternut munchkin to Jay. > > -- > 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.
Re: [racket-users] Typed Racket is Unsound because of module->namespace
Oh? Then should we disable it by default in Racket Sandboxes? (Since this could be used on say, pasterack:) http://pasterack.org/pastes/16888 ~Leif Andersen On Mon, Jul 18, 2016 at 4:34 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > FWIW, `module->namespace` is privileged and guarded by an inspector in > the same way as `(require ffi/unsafe)`. > > At Mon, 18 Jul 2016 16:20:18 -0400, Sam Tobin-Hochstadt wrote: > > This is the same as this bug: > > > http://bugs.racket-lang.org/query/?cmd=view%20audit-trail=default=1 > > 4773 > > > > I think that `eval` should automatically wrap things in the > > `#%top-interaction` of the relevant namespace, which would help in > > some cases, but in general, yes, the top-level is hopeless. > > > > Sam > > > > On Mon, Jul 18, 2016 at 4:14 PM, Leif Andersen <l...@leifandersen.net> > wrote: > > > #lang racket > > > > > > (require syntax/location) > > > > > > (module foo typed/racket > > > (: f (-> Byte Integer)) > > > (define (f x) > > > (+ x 1)) > > > > > > (set! f (λ ([x : Byte]) > > > (+ x 2))) > > > (f 3)) > > > > > > (require 'foo) > > > ((eval 'f (module->namespace (quote-module-path foo))) "world") > > > > > > > > > You're welcome. (Also came up with Alex and Milo) > > > > > > Does the top level make Typed Racket hopeless? > > > > > > ~Leif Andersen > > > > > > -- > > > 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. > > -- > 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] Typed Racket is Unsound because of module->namespace
#lang racket (require syntax/location) (module foo typed/racket (: f (-> Byte Integer)) (define (f x) (+ x 1)) (set! f (λ ([x : Byte]) (+ x 2))) (f 3)) (require 'foo) ((eval 'f (module->namespace (quote-module-path foo))) "world") You're welcome. (Also came up with Alex and Milo) Does the top level make Typed Racket hopeless? ~Leif Andersen -- 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] Constructor-style printing outside of DrRacket?
Although it's an old library, you can use `construction-style-printing` and `mzlib/pconvert` to get this effect. Take the following module: #lang racket (require mzlib/pconvert) (global-port-print-handler (λ (data output [quote-level 0]) (parameterize ([current-output-port output] [constructor-style-printing #t]) (write (print-convert data) '(1 . 2) When evaluated, it prints out: "(cons 1 2)" ~Leif Andersen On Mon, May 30, 2016 at 11:31 AM, Alex Knauth <alexan...@knauth.org> wrote: > Hello, > > DrRacket has a setting that allows me to change the printing style between > four choices: print, constructor, quasiquote, and write. > > Is there a way to turn on constructor-style printing outside of DrRacket? > > If there isn't a simple way to do this, should a simple way be added to > racket? > > Something like: > > > (global-port-print-handler constructor-style-printer) > > (list 1 2 (+ 1 2)) > (list 1 2 3) > > (vector-immutable 1 2 (+ 1 2)) > (vector-immutable 1 2 3) > > I'm mainly trying to avoid `quote` appearing in printouts, and I'm also > trying to avoid literals that implicitly quote their sub-expressions, such as > vector literals. I'm trying to make those print as uses of functions like > `list`, `vector-immutable`, etc. > > DrRacket's options for the printing style are described here: > http://docs.racket-lang.org/drracket/output-syntax.html > > And DrRacket sets the `global-port-print-handler` parameter here: > https://github.com/racket/drracket/blob/master/drracket/drracket/private/language.rkt#L602 > > Alex Knauth > > > -- > 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.
Re: [racket-users] still trying to get coloured text in scribble
Ya, we should probably have a `color` function in scribble/base. Currently you actually have to use `color-property` found in `scribble/core`. You could make your own colorize function like so: ``` (define (colorize #:color c . content) (elem #:style (style #f (color-property c) content)) ``` (Code taken from: http://stackoverflow.com/questions/34888125/change-font-color-in-scribble-html-backend) >From there, you can just do: ``` @colorize[#:color "red"]{WARNING} ``` Hope that helps. ~Leif Andersen On Tue, May 24, 2016 at 6:53 PM, Hendrik Boom <hend...@topoi.pooq.com> wrote: > On Mon, May 23, 2016 at 03:20:53PM -0400, Hendrik Boom wrote: >> Can someone give me an example of coloured text in scribble? > > I've figured out that I need a style connotaining a color-property > but I still have no idea how to code that style in scribble, nor how to > apply it to a piece of text in the middle of a paragraph. > > Presumably I need to @something{ } to delimit the piece of text, and > then somehow apply a style to it. > > THe obvious @color[red]{foo} doesn't work, because color isn't defined. > > -- hendrik > >> >> -- hendrik >> >> -- >> 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. -- 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] Unicode subscripts in code and scribble
> Should that table be user-extensible? Probably not. Ideally, the best thing to do would be to just fix scribble so that it actually properly compiles to latex rather than leaking it's abstractions. Although that may be too hard to do. :( On the other hand, I'm all down for making a `literal` or `exact` scribble form that spits out the literal text into the target latex or html. (Like what Vincent seems to use in his papers, or is in my `doodle` package.) Then I could see making a user extendable table for any sequence of characters that they want to be converted to latex/html/whatever the target is. ~Leif Andersen On Wed, Mar 9, 2016 at 8:22 PM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > I think any extension is one that all would want (although I am not sure) > and so maybe pull requests is a good way to extend it? > > There is the issue of conflicting imports at the latex level tho, so maybe > it should be specifiable at the document level. > > Robby > > > On Wednesday, March 9, 2016, Vincent St-Amour > <stamo...@eecs.northwestern.edu> wrote: >> >> Should that table be user-extensible? >> >> Vincent >> >> >> On Wed, 09 Mar 2016 17:11:47 -0600, >> Robby Findler wrote: >> > >> > I think that maybe you're thinking of something fancier than what's >> > there. It just takes some (small) set of well-known unicode and has >> > corresponding latex commands. Then, in the latex backend for scribble, >> > it looks up latex in that table and drops it in, if it finds it. >> > >> > Robby >> > >> > On Wed, Mar 9, 2016 at 5:09 PM, Leif Andersen <l...@leifandersen.net> >> > wrote: >> > >> Scribble has a big table mapping unicode to latex commands. Maybe it >> > > needs another entry? >> > > >> > > Woah, does that actually work? I was under the impression there were >> > > unicode characters that could combine other unicode characters. >> > > >> > > (Although I'd love to be wrong about this. :) ) >> > > >> > > ~Leif Andersen >> > > >> > > >> > > On Wed, Mar 9, 2016 at 5:55 PM, Robby Findler >> > > <ro...@eecs.northwestern.edu> wrote: >> > >> Scribble has a big table mapping unicode to latex commands. Maybe it >> > >> needs another entry? >> > >> >> > >> Robby >> > >> >> > >> >> > >> On Wed, Mar 9, 2016 at 4:07 PM, David Van Horn <dvanh...@cs.umd.edu> >> > >> wrote: >> > >>> Yes, the problem then is the code font doesn't support that >> > >>> character >> > >>> so it doesn't show up. >> > >>> >> > >>> David >> > >>> >> > >>> >> > >>> On Wed, Mar 9, 2016 at 5:05 PM, Leif Andersen >> > >>> <l...@leifandersen.net> wrote: >> > >>>> Have you tried running the outputted tex file in xetex rather than >> > >>>> pdflatex? >> > >>>> >> > >>>> ~Leif Andersen >> > >>>> >> > >>>> >> > >>>> On Wed, Mar 9, 2016 at 5:03 PM, David Van Horn >> > >>>> <dvanh...@cs.umd.edu> wrote: >> > >>>>> I have some source code I'm trying to typeset in a racketblock >> > >>>>> that >> > >>>>> uses subscript characters like ₀. This breaks when it gets to >> > >>>>> latex. >> > >>>>> Is there some workaround to generate latex friendly output? >> > >>>>> >> > >>>>> Thanks, >> > >>>>> David >> > >>>>> >> > >>>>> -- >> > >>>>> 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. >> > >>> >> > >>> -- >> > >>> 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. -- 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] Unicode subscripts in code and scribble
> Scribble has a big table mapping unicode to latex commands. Maybe it needs another entry? Woah, does that actually work? I was under the impression there were unicode characters that could combine other unicode characters. (Although I'd love to be wrong about this. :) ) ~Leif Andersen On Wed, Mar 9, 2016 at 5:55 PM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > Scribble has a big table mapping unicode to latex commands. Maybe it > needs another entry? > > Robby > > > On Wed, Mar 9, 2016 at 4:07 PM, David Van Horn <dvanh...@cs.umd.edu> wrote: >> Yes, the problem then is the code font doesn't support that character >> so it doesn't show up. >> >> David >> >> >> On Wed, Mar 9, 2016 at 5:05 PM, Leif Andersen <l...@leifandersen.net> wrote: >>> Have you tried running the outputted tex file in xetex rather than pdflatex? >>> >>> ~Leif Andersen >>> >>> >>> On Wed, Mar 9, 2016 at 5:03 PM, David Van Horn <dvanh...@cs.umd.edu> wrote: >>>> I have some source code I'm trying to typeset in a racketblock that >>>> uses subscript characters like ₀. This breaks when it gets to latex. >>>> Is there some workaround to generate latex friendly output? >>>> >>>> Thanks, >>>> David >>>> >>>> -- >>>> 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. >> >> -- >> 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.
Re: [racket-users] Unicode subscripts in code and scribble
Have you tried running the outputted tex file in xetex rather than pdflatex? ~Leif Andersen On Wed, Mar 9, 2016 at 5:03 PM, David Van Horn <dvanh...@cs.umd.edu> wrote: > I have some source code I'm trying to typeset in a racketblock that > uses subscript characters like ₀. This breaks when it gets to latex. > Is there some workaround to generate latex friendly output? > > Thanks, > David > > -- > 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.
Re: [racket-users] DrR: meta-q just worked!
I am too, thank you. Although it seems to split words from there open parenthesis. For example: ``` hello (some text) ``` Can be come (if it needs to split the line): ``` hell ( some text) ``` This is problematic because scribble seems to interpret the line break as a space, and thus putting a space between `(` and `some`. Perhaps it would make more sense to keep `(` attached with the word it is with? ~Leif Andersen On Sat, Mar 5, 2016 at 9:14 AM, Jens Axel Søgaard <jensa...@soegaard.net> wrote: > Is there a way to set the paragraph width to 80 (it seems to be set to 60)? > > /Jens Axel > > > 2016-03-04 21:06 GMT+01:00 Robby Findler <ro...@eecs.northwestern.edu>: >> >> Lei Wang actually implemented it. I gave him some advice about it, but >> it was his work. I'm very happy he did it too! >> >> https://github.com/LeiWangHoward >> >> Robby >> >> >> On Fri, Mar 4, 2016 at 10:31 AM, Matthias Felleisen >> <matth...@ccs.neu.edu> wrote: >> > >> > Thank you Robby. He added this a while back because it was my primary >> > complaint about scribble in dr. >> > >> > >> > On Mar 4, 2016, at 10:40 AM, "'John Clements' via Racket Users" >> > <racket-users@googlegroups.com> wrote: >> > >> >> I was editing scribble code, and by reflex, typed meta-q to reflow the >> >> text. I was somewhat astonished when it worked. Is this a recent >> >> change? >> >> >> >> I think I take DrRacket for granted way too often. Many, many thanks >> >> for >> >> an awesome IDE. >> >> >> >> John >> >> >> >> >> >> >> >> -- >> >> 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. >> >> -- >> 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. > > > > > -- > -- > Jens Axel Søgaard > > -- > 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.
Re: [racket-users] Writing a blank to a file
To clarify what Stephen wrote there a bit, you should probably want to only use `display` here. To a first approximation, `write` is used for writing out values that you can read back in with `read`. (This doesn't work in general and you actually want to make things marshlable if that is your goal, but that's the general idea anyway.) `display` on the other hand, is used for writing out arbitrary text to `current-output-port`. For this reason, I tend to like `printf` and `format` more than `display`. ~Leif Andersen On Wed, Mar 2, 2016 at 1:15 PM, Stephen Chang <stch...@ccs.neu.edu> wrote: > Use display? or set read-accept-bar-quote to #f > > On Wed, Mar 2, 2016 at 1:12 PM, Marco Morazan <moraz...@gmail.com> wrote: >> >> Hi All, >> >> I seem to recall I knew how to do this once, but can't recall the details. >> >> How do we write a blank to a text file without the parallel bars appearing? >> >> So, (write '| | outfile) produces | | in the file. I want to eliminate the >> vertical bars. >> >> Thanks, >> >> Marco >> >> -- >> 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. -- 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] Appropriate open source license for a Racket based framework
So, if you're not actually shipping Racket with your framework, I don't think it really matters. And even if you are, as long as you make it possible to relink to my own copy of Racket, I think it's fine too (as Racket is under the GPL). (At least, I hope it's fine, as I also have projects under the X11/MIT license (nanopass).) ~Leif Andersen On Wed, Mar 2, 2016 at 12:25 PM, Brian Adkins <lojicdot...@gmail.com> wrote: > On Wednesday, March 2, 2016 at 12:17:55 AM UTC-5, Neil Van Dyke wrote: >> Brian Adkins wrote on 03/01/2016 11:31 PM: >> > Are there any particular license issues that I should be aware of in this >> > regard? >> >> I don't know. Looks like core Racket is now LGPLv3, which is pretty >> flexible about commercial uses. I've been using LGPLv3 for almost all >> of my Racket packages since around 2009, and LGPLv2-something before >> that. (One exception is that a financial data scraping package of mine >> is GPL, and I also was working on a Racket firmware that was GPL.) The >> legal notice in the documentation of each of my packages says people can >> contact me about alternative licenses. In the last 13 years, I recall >> only once someone asking about the license for one of my Racket/Scheme >> packages, and it turned out the person was fine with LGPLv3. >> >> Neil V. > > Thanks. I've decided to go with the MIT License initially, this is *very* > early in the process, so if a license change was deemed to be worthwhile > later, it would be fine. > > -- > 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] `compile-omit-paths` seems to be ignored when creating a package.
Hello, I have a package I'm working on which has a 'samples/' folder, which includes samples of code that should not be compiled. By default, when I go to build the package, I get errors when the program is trying to build the project. So, I added: > (define compile-omit-paths '("samples")) to my info.rkt file. When I run `raco pkg install `, I still get errors when it tryies to build the "samples/" directory. Is there anything I'm missing when trying to add those compile paths? (Also, this is a 'multi collection, and in the same info.rkt file as "(define collection 'multi)" if that is important.) Thanks. ~Leif Andersen -- 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] Licensing Details (Is there a Runtime Library Exception?)
> yes, I noticed that, but I'm not sure that makes any difference in this case. > If code ends up being JITed together with the runtime libraries during > execution there's no "easy relinking" possible any more. So, if you give me the .zo file that you get when you run `raco make`, I can (at least in theory) take that .zo file and run it against different implementations of the Racket VM. I think that is what the page is talking about how it interprets relinking. > If the intention wasn't to force programs written in racket to be open > source, then why wasn't an explicit exemption of the runtime libraries made, > like other projects have? (As stated, like it was done for e.g. GCC and Java.) This is probably because none of us are lawyers. And are thus hesitant to write legal documents. > So shipping the executable already trivially satisfies the LGPL then? (At > least given racket-lang.org's current interpretation of the LGPL.) That and the .zo file that you get by running raco make. Again though, I am not a lawyer. So if you need actual professional legal advice, please get an actual one. ~Leif Andersen On Fri, Feb 12, 2016 at 2:08 AM, George Bevan <g.u.be...@gmail.com> wrote: > Thanks for the prompt reply. > > Maybe I didn't look close enough - the license page I landed on was this one: > http://docs.racket-lang.org/license/index.html > > Still, > >> This page points out that Racket is released under the LGPL (rather >> than the GPL) > > yes, I noticed that, but I'm not sure that makes any difference in this case. > If code ends up being JITed together with the runtime libraries during > execution there's no "easy relinking" possible any more. > > If the intention wasn't to force programs written in racket to be open > source, then why wasn't an explicit exemption of the runtime libraries made, > like other projects have? (As stated, like it was done for e.g. GCC and Java.) > > >> Furthermore, this is not revealing any more of your source code than >> the raco exe format, since the bytecode is embedded in an extractable >> way in the resulting executable. > > So shipping the executable already trivially satisfies the LGPL then? (At > least given racket-lang.org's current interpretation of the LGPL.) > > > On Friday, February 12, 2016 at 7:46:45 AM UTC+1, Leif Andersen wrote: >> You can find the license that Racket is released under here: >> https://download.racket-lang.org/license.html >> >> This page points out that Racket is released under the LGPL (rather >> than the GPL), and also says: >> >> First, if you distribute your Racket application in source form or as >> compiled bytecode files, the Racket license does not restrict you at >> all. >> >> Second, if you distribute your Racket application as compiled binary >> generated by raco exe, there are no requirements placed on the >> licensing of your software. However, the LGPL requires that you make >> it possible to re-link your software with modified versions of Racket. >> This means, basically, that you need to provide the compiled bytecode >> files used to produce the compiled binary, if requested by someone who >> got your software from you. Note that this does not mean that your >> software has to be made open source, nor do you have to give the >> source code to anyone, nor do you have to make the compiled bytecode >> files available to the public or let other people redistribute them. >> Furthermore, this is not revealing any more of your source code than >> the raco exe format, since the bytecode is embedded in an extractable >> way in the resulting executable. >> >> (It also says at the bottom of the page: We are, of course, not >> lawyers, and this should not be taken as legal advice. However, we >> wanted to make it clear that Racket is an appropriate building block >> for all kinds of software, and to clarify how we view the license of >> Racket.) >> >> Hope that helps. >> >> ~Leif Andersen >> >> >> On Fri, Feb 12, 2016 at 1:40 AM, George Bevan <g.u.be...@gmail.com> wrote: >> > Do programs written in Racket that use the libraries of racket-lang.org's >> > implementation need to be licensed under GPL terms? Much like it is the >> > case with e.g. the libraries in AdaCore's Ada implementation? >> > >> > Or is there a "Runtime Library Exception" or a "Classpath Exception" or >> > similar, like it is the case for GCC or Java/JDK? >> > >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Racket
Re: [racket-users] Licensing Details (Is there a Runtime Library Exception?)
You can find the license that Racket is released under here: https://download.racket-lang.org/license.html This page points out that Racket is released under the LGPL (rather than the GPL), and also says: First, if you distribute your Racket application in source form or as compiled bytecode files, the Racket license does not restrict you at all. Second, if you distribute your Racket application as compiled binary generated by raco exe, there are no requirements placed on the licensing of your software. However, the LGPL requires that you make it possible to re-link your software with modified versions of Racket. This means, basically, that you need to provide the compiled bytecode files used to produce the compiled binary, if requested by someone who got your software from you. Note that this does not mean that your software has to be made open source, nor do you have to give the source code to anyone, nor do you have to make the compiled bytecode files available to the public or let other people redistribute them. Furthermore, this is not revealing any more of your source code than the raco exe format, since the bytecode is embedded in an extractable way in the resulting executable. (It also says at the bottom of the page: We are, of course, not lawyers, and this should not be taken as legal advice. However, we wanted to make it clear that Racket is an appropriate building block for all kinds of software, and to clarify how we view the license of Racket.) Hope that helps. ~Leif Andersen On Fri, Feb 12, 2016 at 1:40 AM, George Bevan <g.u.be...@gmail.com> wrote: > Do programs written in Racket that use the libraries of racket-lang.org's > implementation need to be licensed under GPL terms? Much like it is the case > with e.g. the libraries in AdaCore's Ada implementation? > > Or is there a "Runtime Library Exception" or a "Classpath Exception" or > similar, like it is the case for GCC or Java/JDK? > > -- > 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] Call for Google Summer of Code Project Suggestions
Hello All, We are in the process of submitting a Google Summer of Code application for Racket. If you have an idea for a self contained project that would benefit the community, please let us know. These should be projects that a student would be able to complete in about 3 months. We will curate a subset of these ideas, and put together a detailed list of potential projects for students. Here are some example suggestions from Asumu: * Type-based auto-completion * Memory profiler * Video editing DSL (#lang nlve) * Automatically generate typed wrappers from tests or contracts * Improve DrRacket vim plugin * TOTP two-factor auth library for Racket-based websites * Command-line REPL debugger * Pure Racket line editing for XREPL with paren-matching and other goodies * RRB-Trees built into the Racket VM as an alternative to immutable vectors As well as some suggestions we have from previous years: https://github.com/racket/racket/wiki/SoC-Ideas-2012 Thank you. ~Leif Andersen -- 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] How to profile compilation and macro expansion?
Hey stef. First of all, thank you so much for trying this out. I agree that nanopass in Racket is way to slow (triply (or 10x) so in DrRacket), and it really shouldn't be so slow. And I would love to work with you to help speed it up. >(require compiler/compile-file) >(compile-file "c.rkt") The probelm with this is that the reader is currently not able to read the file. The following file however will allow `compile-file` to work: #lang racket (require compiler/compile-file) (current-directory "src/racket-to-c") ; Replace with path to c.rkt (read-accept-reader #t) (parameterize ([current-namespace (make-base-namespace)]) (compile-file "./c.rkt")) Another thing is that you don't need to run the compiler here, so much as the macro expander. Hope this helps. ~Leif Andersen On Wed, Feb 10, 2016 at 4:58 PM, stef <muf...@gmail.com> wrote: > I've been trying out nanopass > (https://github.com/nanopass/nanopass-framework-racket) and its tutorial > scheme-to-c compiler (https://github.com/LeifAndersen/racket-to-c). However, > Racket takes easily 20s to bytecompile the c compiler, which is totally > unacceptable, especially with Racket's normal flow of resetting the > environment on every compile. > > How can I profile this so I can figure out what's taking so long? "raco make > --vv" is totally uninformative and I don't see any profiling library for > macros. > > To be clear, I'm not specifically worried about nanopass or this compiler as > such, but about trying similar macro-heavy strategies to implement languages > later. Typed Racket has similar huge performance problems, so I'm actually > worried about fundamental limitations of Racket as a host. > > However, TR is far too big for me to poke around in (I tried). I mostly get > what nanopass is doing though, and the slowness is more surprising, so I > thought it would make a better starting point for learning how to improve > macro performance. > > So first step: measure what the compiler is actually doing. :) > > I thought I might just be able to essentially call: > > (require compiler/compile-file) > (compile-file "c.rkt") > > and then normally profile that, but compile-file seems to choke on the #lang. > > After more reading, tried this: > > (require compiler/cm) > (require profile) > (profile (managed-compile-zo "./c.rkt")) > > which I can run with racket, but which gives me totally opaque profiling > data. (Ditto with errortrace on.) (And I can't get it to run in DrRacket at > all because it doesn't understand PWD or something.) > > -- > 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.
Re: [racket-users] Top Level Variables or List of Shared Libraries
Since a lot of people were at POPL last week, I think it's worth pinging this list again. Does anyone have a solution to the problem stated in the previous email? Namely, is there a way to either create a top-level variable that persists until the VM dies, get a list of all dynamically linked libraries, or require a module implemented in C who's module name differs from it's file name? Thank you. Thank you. ~Leif Andersen On Tue, Jan 19, 2016 at 3:20 PM, John Clements <cleme...@brinckerhoff.org> wrote: > >> On Jan 19, 2016, at 11:14 AM, Leif Andersen <l...@leifandersen.net> wrote: >> >> Is it possible to either create a variable that persists until the >> Racket VM shuts down or get a list of all of the libraries that are >> shared libraries that are currently being linked against the racket >> vm? > > I can’t help you. But! This reminds me of a closely related problem that > occurs with the `rsound` library. > > The rsound library contains shared libraries. Running rsound programs > performs dynamic linking against these libraries. > > When students try to upgrade the package, terrible things happen; the update > tries to replace the file, and the OS won’t allow it, because the dynamic > library is still linked. This leaves things in a half-installed state from > which (IIRC) it’s difficult to recover. If there were a way to enumerate > currently-linked shared libraries, the update could simply refuse to run, > which would be a substantial improvement. > > CAVEAT: I haven’t tested this in the last two years. Please forgive me if > this problem has already been resolved. > > Thanks! > > John > > > -- 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] Top Level Variables or List of Shared Libraries
That seems to work, thank you. ~Leif Andersen On Thu, Jan 28, 2016 at 4:05 PM, Ryan Culpepper <ry...@ccs.neu.edu> wrote: > The openssl library uses scheme_register_process_global to make sure it > initializes the openssl foreign library only once. See the end of > openssl/mzssl.rkt. > > Ryan > > > > On 01/28/2016 02:33 PM, Leif Andersen wrote: >> >> Since a lot of people were at POPL last week, I think it's worth >> pinging this list again. >> >> Does anyone have a solution to the problem stated in the previous email? >> >> Namely, is there a way to either create a top-level variable that >> persists until the VM dies, get a list of all dynamically linked >> libraries, or require a module implemented in C who's module name >> differs from it's file name? >> >> Thank you. >> >> Thank you. >> >> ~Leif Andersen >> >> >> On Tue, Jan 19, 2016 at 3:20 PM, John Clements >> <cleme...@brinckerhoff.org> wrote: >>> >>> >>>> On Jan 19, 2016, at 11:14 AM, Leif Andersen <l...@leifandersen.net> >>>> wrote: >>>> >>>> Is it possible to either create a variable that persists until the >>>> Racket VM shuts down or get a list of all of the libraries that are >>>> shared libraries that are currently being linked against the racket >>>> vm? >>> >>> >>> I can’t help you. But! This reminds me of a closely related problem that >>> occurs with the `rsound` library. >>> >>> The rsound library contains shared libraries. Running rsound programs >>> performs dynamic linking against these libraries. >>> >>> When students try to upgrade the package, terrible things happen; the >>> update tries to replace the file, and the OS won’t allow it, because the >>> dynamic library is still linked. This leaves things in a half-installed >>> state from which (IIRC) it’s difficult to recover. If there were a way to >>> enumerate currently-linked shared libraries, the update could simply refuse >>> to run, which would be a substantial improvement. >>> >>> CAVEAT: I haven’t tested this in the last two years. Please forgive me if >>> this problem has already been resolved. >>> >>> Thanks! >>> >>> John >>> >>> >>> >> > > -- > 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] Top Level Variables or List of Shared Libraries
Is it possible to either create a variable that persists until the Racket VM shuts down or get a list of all of the libraries that are shared libraries that are currently being linked against the racket vm? The reason why I ask is because I created a `from-c` require form[1], which takes in a C implementation of a module, compiles it, links it, and then loads the module. So using it would look something like this: #lang racket/base (require zordoz (from-c "foo.c")) However, it seems very unsafe to just recompile link and load the c file every time a module is run, because if the module is changed, the old version of the module will still remain. Worse still, it could cause the program to crash. And it's not trivial to unload the linked library and reload it at run time. So, I want to test if the module has already been compiled and linked, if so, skip the compile process and just load the module. (Or if the c file was modified throw an error telling the user to restart the VM.) In order to do this, I either need to use a list of all of the shared libraries linked with the Racket VM, or make that list myself. Now, I tried putting that list in the module, and just mutating it whenever a file is loaded[2]. This, however, doesn't work in an environment like DrRacket where it uses a sandbox to emulate a new racket environment, but it is still technically running in the same vm. (It fails because the module seems to get reloaded, and thus the list gets reset.) Thus, is there a way I can get a list of all of the currently linked libraries, or create a persistent variable that lasts as long as the VM is running? The `current-standard-link-libraries`[3] parameter doesn't work here because it only lists the standard libraries that are linked to the VM, and thus not ones that are loaded with `link-extension`. As a side note, an alternative approach I took to this problem was to compile a fresh version of the library with a new file name every single time the require form was run. (Which would create a bunch of extra files, but ideally those could be deleted when the VM shuts down. Again, kind of odd, but I wouldn't use this `from-c` think in anything besides quick tests anyway, so I don't think it matters too much.) I made an implementation of that here[4] (there are a few bugs in the counting code for creating new files, and it currently just stays at 0. That's not the problem though.) Whenever I use this code, to require something `from-c`, I get the following error: load-extension: expected module not found expected: syntax-grabber-0 found: module `syntax-grabber' path: /Users/leif/compiled/native/x86_64-macosx/3m/syntax-grabber-0.dylib Which is odd, because the `names` variable is in fact `syntax-grabber`, not `syntax-grabber-0`. And when I run this code in a `begin-for-syntax` rather than a `make-require-transformer` it works fine. So is there anyway I can either: (a) Get a list of all of the shared objects that are currently linked against the VM (ideally without using the FFI), (b) Keep a variable that persists until the VM terminates, (c) or load a module who's file name differs from the module it instantiates? Thank you. [1]: http://pasterack.org/pastes/11082 [2]: http://pasterack.org/pastes/36865 [3]: http://docs.racket-lang.org/dynext/Linking.html?q=dynext%2Flink#%28def._%28%28lib._dynext%2Flink..rkt%29._current-standard-link-libraries%29%29 [4]: http://pasterack.org/pastes/63016 ~Leif Andersen -- 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] Re: More compile/eval Confusion
Yes, this worked for me, thank you. It also uncovered a bug in my tests where test namespaces where leaking out of the tests, thus affecting future tests. Thank you again. ~Leif Andersen On Sat, Dec 26, 2015 at 6:23 AM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > At Fri, 25 Dec 2015 16:58:53 -0700, Leif Andersen wrote: >> That's what I thought initially too, but it didn't seem to make a >> difference when I used >> `expand-syntax-top-level-with-compile-time-evals`, although then I >> realized that perhaps a better function to use would be >> `eval-compile-time-part-of-top-level/compile`, and than evaling each >> of those expressions, giving: >> >> (map eval (eval-compile-time-part-of-top-level/compile >> (expand-syntax-top-level-with-compile-time-evals prog))) >> >> But then I get the same error: >> >> racket/racket/collects/racket/private/map.rkt:21:13: x: undefined; >> cannot reference undefined identifier > > It looks like this problem is a weakness of > `expand-syntax-top-level-with-compile-time-evals` for handling > `require` forms that have scopes other than the current namespace's > scopes. > > This variation works as you expect: > > (parameterize ([current-namespace (make-base-namespace)]) >(map eval (eval-compile-time-part-of-top-level/compile > (expand-syntax-top-level-with-compile-time-evals >(namespace-syntax-introduce (strip-context prog)) > > > The problem with `require` handling is that it uses > `namespace-require/expansion-time`, which takes a `#%require` spec as a > datum, so there's no way to provide the scopes that `prog` gets from > your enclosing test module. Instead, the current namespace's copes are > used. > > Using `expand-top...` instead of `expand-syntax-top...` works around > the problem, since that adds the namespace's scopes to `prog` so that > the bindings created by `namespace-require/expansion-time` will apply. > > More generally, I can look into repairing > `expand-syntax-top-level-with-compile-time-evals`, but I think you'll > have less trouble in the long run if you don't mix up scopes from a > test environment with scopes from a compilation namespace. > > -- > 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] More compile/eval Confusion
Hey, I have found another bit of confusion between eval and compile. Again, I suspect it's related to using a top level begin, but I'm not sure why. I have the following program: #lang racket (define prog #'(begin (module foo racket (#%plain-module-begin (provide x) (define x 5))) (require 'foo) x)) ; (eval prog) ; (eval (compile prog)) When I uncomment the first line to run `(eval prog)` the program runs fine. However, when I uncomment the second line to run `(eval (compile prog))`, I get the following error: define-values: assignment disallowed; cannot re-define a constant constant: x Also, when I use syntax/toplevel and add the following line: `(eval (compile (expand-syntax-top-level-with-compile-time-evals prog)))` I get the same error. Can you give me some intuition as to what the problem is here? ~Leif Andersen -- 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] Re: More compile/eval Confusion
I should probably also mention that if I comment out the first eval leaving only `(compile (eval prog))`, I get: x: undefined; cannot reference undefined identifier Which leads me to think that the other error is from trying to require the same module twice in the same namespace. But I'm still not sure what the cause of the other issue is though. ~Leif Andersen On Fri, Dec 25, 2015 at 11:18 AM, Leif Andersen <l...@leifandersen.net> wrote: > Hey, I have found another bit of confusion between eval and compile. > Again, I suspect it's related to using a top level begin, but I'm not > sure why. > > I have the following program: > #lang racket > > (define prog #'(begin > (module foo racket >(#%plain-module-begin > (provide x) > (define x 5))) > (require 'foo) > x)) > ; (eval prog) > ; (eval (compile prog)) > > When I uncomment the first line to run `(eval prog)` the program runs fine. > > However, when I uncomment the second line to run `(eval (compile > prog))`, I get the following error: > > define-values: assignment disallowed; > cannot re-define a constant > constant: x > > Also, when I use syntax/toplevel and add the following line: > `(eval (compile (expand-syntax-top-level-with-compile-time-evals prog)))` > I get the same error. > > Can you give me some intuition as to what the problem is here? > > ~Leif Andersen -- 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] Re: More compile/eval Confusion
> Well, considering my past performance you definitely don't want to to trust me on these questions, but I'll give it a try anyway. :) Ha, well I appreciate the attempt anyway. > My guess is that when you comment in only this line from the last two: > (eval (compile prog)) > then the "x" is compiled into a reference to a top-level variable, not a reference to the variable exported from the module "foo" because compile compiles the whole expression at once, and so it doesn't seem that there's now a module export that it should compile the top-level variable "x" into. and > I agree with Robby's explanation on just the `compile` line. That's what I thought initially too, but it didn't seem to make a difference when I used `expand-syntax-top-level-with-compile-time-evals`, although then I realized that perhaps a better function to use would be `eval-compile-time-part-of-top-level/compile`, and than evaling each of those expressions, giving: (map eval (eval-compile-time-part-of-top-level/compile (expand-syntax-top-level-with-compile-time-evals prog))) But then I get the same error: racket/racket/collects/racket/private/map.rkt:21:13: x: undefined; cannot reference undefined identifier For what it's worth, as soon as I evaluate the first expression from the list, I can then type in (require 'foo) into the repl myself, and then use x. So maybe it's again, getting evaluated in a different namespace? > After you instantiate a module in a given namespace, you can't redefine or otherwise mutate that module's immutable variables in the same namespace... That makes a lot of sense, thanks. ~Leif Andersen On Fri, Dec 25, 2015 at 4:37 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > I agree with Robby's explanation on just the `compile` line. > > When you uncomment both lines, it's the same error as as > > > (module m racket/base (define x 5)) > > (require 'm) > > (module m racket/base (define x 5)) > define-values: assignment disallowed; > cannot re-define a constant >constant: x >in module: 'm > > After you instantiate a module in a given namespace, you can't redefine > or otherwise mutate that module's immutable variables in the same > namespace. (The absence of any `set!` in the original module means that > `x` is immutable.) Granted, the new value would be the same as the old > one in this case, so `x` wouldn't actually change, but redefinition is > disallowed anyway. > > If you really want to declare a module multiple times, then you can set > `compile-enforce-module-constants` to #f: > > > (compile-enforce-module-constants #f) > > (module m racket/base (define x 5)) > > (require 'm) > > (module m racket/base (define x 5)) ; no error > > > At Fri, 25 Dec 2015 15:34:20 -0600, Robby Findler wrote: >> Well, considering my past performance you definitely don't want to to >> trust me on these questions, but I'll give it a try anyway. :) >> >> My guess is that when you comment in only this line from the last two: >> >>(eval (compile prog)) >> >> then the "x" is compiled into a reference to a top-level variable, not >> a reference to the variable exported from the module "foo" because >> compile compiles the whole expression at once, and so it doesn't seem >> that there's now a module export that it should compile the top-level >> variable "x" into. >> >> Similarly, the first expression in the module just below produces 1 >> and the second one produces an error. >> >> #lang racket >> >> (parameterize ([current-namespace (make-base-namespace)]) >> (define xc (compile #'x)) >> (eval '(define x 1)) >> (eval xc)) >> >> (parameterize ([current-namespace (make-base-namespace)]) >> (define xc (compile #'x)) >> (eval '(module m racket/base (define x 1) (provide x))) >> (eval '(require 'm)) >> (eval xc)) >> >> Robby >> >> >> On Fri, Dec 25, 2015 at 3:00 PM, Leif Andersen <l...@leifandersen.net> wrote: >> > I should probably also mention that if I comment out the first eval >> > leaving only `(compile (eval prog))`, I get: >> > >> > x: undefined; >> > cannot reference undefined identifier >> > >> > >> > Which leads me to think that the other error is from trying to require >> > the same module twice in the same namespace. >> > >> > >> > But I'm still not sure what the cause of the other issue is though. >> > >> > ~Leif Andersen >> > >> > >> > On Fri, Dec 25, 2015 at 11:18 AM, Leif Andersen <l...@leifandersen.net> >> wrote: &g
Re: [racket-users] Confused about the difference between the REPL and the toplevel.
Okay, thank you for the explanation. I totally see what you mean now by the top level being hopeless. (Or at least I think I do.) It seems there is no way to get a meaning that does everything we would want it to... As a side not Matthew, I notice that you seem to be sending out two identical emails every time you send out an email. If memory serves you use Mr Ed, right? I wonder if that might be a bug. ~Leif Andersen On Tue, Dec 22, 2015 at 6:54 AM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > Oh right. Sorry for the confusion! > > Robby > > > On Tuesday, December 22, 2015, Matthew Flatt <mfl...@cs.utah.edu> wrote: >> >> I think Robby was confused by your example (which is understandable). >> >> The `expand` function does not splice any differently than `compile`, >> so `compile` behaves the same as `expand` in your example: >> >> > (eval (compile #'(begin >> (define-syntax (foo stx) >> (displayln "hello") >> #'5) >> foo))) >> foo: undefined; >> cannot reference undefined identifier >>context...: >> /Users/mflatt/plt/racket/collects/racket/private/misc.rkt:87:7 >> > (compile #'(begin >> (define-syntax (foo stx) >> (displayln "goodbye") >> #'5) >> foo)) >> hello >> #~ >> >> >> I think Robby was just confused by your example, because he's used to >> starting with a fresh REPL. :) >> >> At Mon, 21 Dec 2015 22:16:44 -0700, Leif Andersen wrote: >> > Wait, now I'm even more confused. If expand does the splicing and >> > compile time evals song and dance, why do we need a separate function >> > for: >> > >> > expand-syntax-top-level-with-compile-time-evals >> > >> > ? >> > >> > ~Leif Andersen >> > >> > >> > On Mon, Dec 21, 2015 at 9:48 PM, Robby Findler >> > <ro...@eecs.northwestern.edu> wrote: >> > > I believe that's because expand does the splicing dance, but compile >> > > doesn't (which is why you need the funny-named function ... "need" is >> > > perhaps a poor choice of words here :). >> > > >> > > Robby >> > > >> > > >> > > On Mon, Dec 21, 2015 at 10:30 PM, Leif Andersen >> > > <l...@leifandersen.net> >> > wrote: >> > >> Ah, that's a good question. One that I don't really know the answer >> > >> too, because when I do: >> > >> >> > >>> (compile #'(begin >> > >>(define-syntax (foo stx) >> > >> (displayln "hello") >> > >> #'5) >> > >>foo)) >> > >> >> > >> I get back the compiled object. Also foo is not displayed. And when I >> > >> do: >> > >> >> > >> > (eval (compile #'(begin >> > >>(define-syntax (foo stx) >> > >> (displayln "hello") >> > >> #'5) >> > >>foo))) >> > >> >> > >> I get the error: >> > >> >> > >> foo: undefined; >> > >> cannot reference an identifier before its definition >> > >> >> > >> But, when I do: >> > >> >> > >>> (expand #'(begin >> > >>(define-syntax (foo stx) >> > >> (displayln "hello") >> > >> #'5) >> > >>foo)) >> > >> >> > >> It displays 'hello' to the console. And expands to what I would >> > >> expect it >> > too. >> > >> >> > >> ~Leif Andersen >> > >> >> > >> >> > >> On Mon, Dec 21, 2015 at 9:15 PM, Alex Knauth <alexan...@knauth.org> >> > >> wrote: >> > >>> >> > >>>> On Dec 21, 2015, at 10:53 PM, Leif Andersen <l...@leifandersen.net> >> > >>>> wrote: >> > >>> >> > >>>> But `compile` is not supposed to evaluate any code, it just >> > >>>> compiles >> > >>>> it. Which is why it fails to compile that code. But if you >> > >>>> interle
[racket-users] Confused about the difference between the REPL and the toplevel.
So, I was under the impression that the REPL was the toplevel (unless you entered a module context or something like that). But I just had something challenge that assumption and so now I'm a bit confused. I have the following top level program: (begin (require (for-meta 1 racket) (for-meta 2 racket)) (begin-for-syntax (begin-for-syntax (define x 5 When I run this top level program in the REPL, it works just fine. And I can even reference x in later evaluations. (Provided I'm at the meta-level of 2). However, when I pass this top level program into compile like so: http://pasterack.org/pastes/38556 (compile #'(begin (require (for-meta 1 racket) (for-meta 2 racket)) (begin-for-syntax (begin-for-syntax (define x 5) I get the following error: define: unbound identifier at phase 2; also, no #%app syntax transformer is bound in: define Can someone give me the reason (or at least some intuition) as to why this works in the repl, but not at the top level? Thank you. ~Leif Andersen -- 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] Confused about the difference between the REPL and the toplevel.
Ah, okay, that makes sense. Thank you. I didn't realize begin was evaluating each expression as it went. Thank you. ~Leif Andersen On Mon, Dec 21, 2015 at 5:47 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > In the REPL, `begin` splices at the granularity of expansion and > evaluation. That is, the first of the two forms grouped by `begin` is > compiled and evaluated, and only afterward the second one is compiled > and evaluated. > > The `compile` function can't do that, because it's only supposed to > compile -- not evaluate. > > The `syntax/toplevel` library provides > > expand-syntax-top-level-with-compile-time-evals > > as an intermediate point between those: it pulls apart `begin` and > `expands` (which is the interesting part of `compile`) the forms in > sequence, but it evaluates only compile-time parts of the given forms. > That works for many cases, including your example. > > At Mon, 21 Dec 2015 17:35:22 -0700, Leif Andersen wrote: >> So, I was under the impression that the REPL was the toplevel (unless >> you entered a module context or something like that). But I just had >> something challenge that assumption and so now I'm a bit confused. >> >> I have the following top level program: >> >> (begin >> (require (for-meta 1 racket) >>(for-meta 2 racket)) >> (begin-for-syntax >> (begin-for-syntax >> (define x 5 >> >> When I run this top level program in the REPL, it works just fine. And >> I can even reference x in later evaluations. (Provided I'm at the >> meta-level of 2). >> >> However, when I pass this top level program into compile like so: >> http://pasterack.org/pastes/38556 >> >> (compile #'(begin >> (require (for-meta 1 racket) >> (for-meta 2 racket)) >> (begin-for-syntax >>(begin-for-syntax >> (define x 5) >> >> >> I get the following error: >> >> define: unbound identifier at phase 2; >> also, no #%app syntax transformer is bound in: define >> >> Can someone give me the reason (or at least some intuition) as to why >> this works in the repl, but not at the top level? >> >> Thank you. >> >> ~Leif Andersen >> >> -- >> 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. -- 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] Confused about the difference between the REPL and the toplevel.
Ah, that's a good question. One that I don't really know the answer too, because when I do: > (compile #'(begin (define-syntax (foo stx) (displayln "hello") #'5) foo)) I get back the compiled object. Also foo is not displayed. And when I do: > (eval (compile #'(begin (define-syntax (foo stx) (displayln "hello") #'5) foo))) I get the error: foo: undefined; cannot reference an identifier before its definition But, when I do: > (expand #'(begin (define-syntax (foo stx) (displayln "hello") #'5) foo)) It displays 'hello' to the console. And expands to what I would expect it too. ~Leif Andersen On Mon, Dec 21, 2015 at 9:15 PM, Alex Knauth <alexan...@knauth.org> wrote: > >> On Dec 21, 2015, at 10:53 PM, Leif Andersen <l...@leifandersen.net> wrote: > >> But `compile` is not supposed to evaluate any code, it just compiles >> it. Which is why it fails to compile that code. But if you interleave >> it with evals, it will run the require code, which gives the phase >> level 2 code some meaning. > > I understand that `compile` isn't supposed to evaluate any _runtime_ code, > but I thought it had to evaluate the compile-time code for it to compile the > program? > > Am I misunderstanding what `compile` is supposed to do? Or what compile-time > code is, or? > >> Does that make any sense, or was it too rambly. >> >> ~Leif Andersen >> >> >> On Mon, Dec 21, 2015 at 8:24 PM, Alex Knauth <alexan...@knauth.org> wrote: >>> I get that `compile` doesn't evaluate the require form, but why doesn't it >>> evaluate what's needed for compile time? I thought that was the reason for >>> needing require as a macro instead of a function. Or am I getting the >>> purpose of compile wrong? >>> >>> Alex Knauth >>> >>>> On Dec 21, 2015, at 7:47 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: >>>> >>>> In the REPL, `begin` splices at the granularity of expansion and >>>> evaluation. That is, the first of the two forms grouped by `begin` is >>>> compiled and evaluated, and only afterward the second one is compiled >>>> and evaluated. >>>> >>>> The `compile` function can't do that, because it's only supposed to >>>> compile -- not evaluate. >>>> >>>> The `syntax/toplevel` library provides >>>> >>>> expand-syntax-top-level-with-compile-time-evals >>>> >>>> as an intermediate point between those: it pulls apart `begin` and >>>> `expands` (which is the interesting part of `compile`) the forms in >>>> sequence, but it evaluates only compile-time parts of the given forms. >>>> That works for many cases, including your example. >>>> >>>> At Mon, 21 Dec 2015 17:35:22 -0700, Leif Andersen wrote: >>>>> So, I was under the impression that the REPL was the toplevel (unless >>>>> you entered a module context or something like that). But I just had >>>>> something challenge that assumption and so now I'm a bit confused. >>>>> >>>>> I have the following top level program: >>>>> >>>>> (begin >>>>> (require (for-meta 1 racket) >>>>> (for-meta 2 racket)) >>>>> (begin-for-syntax >>>>> (begin-for-syntax >>>>> (define x 5 >>>>> >>>>> When I run this top level program in the REPL, it works just fine. And >>>>> I can even reference x in later evaluations. (Provided I'm at the >>>>> meta-level of 2). >>>>> >>>>> However, when I pass this top level program into compile like so: >>>>> http://pasterack.org/pastes/38556 >>>>> >>>>> (compile #'(begin >>>>>(require (for-meta 1 racket) >>>>> (for-meta 2 racket)) >>>>>(begin-for-syntax >>>>> (begin-for-syntax >>>>>(define x 5) >>>>> >>>>> >>>>> I get the following error: >>>>> >>>>> define: unbound identifier at phase 2; >>>>> also, no #%app syntax transformer is bound in: define >>>>> >>>>> Can someone give me the reason (or at least some intuition) as to
Re: [racket-users] Confused about the difference between the REPL and the toplevel.
So, the way I understand it (and please correct me if I'm wrong), is that require is a macro for #%require, which is converted by the compiler to either a top level require form, or part of the module's require field. (Depending on where it goes). When you put a `begin-for-syntax` or a `define-syntax` in your macro, the bindings of each of the bodies need to become those of one phase level up, which enables the macro expander to further expand the macros in the expanded code. (This is better explained in the "You Want it When" paper. https://www.cs.utah.edu/plt/publications/macromod.pdf ) The problem here is that by default, Racket only loads racket/base at phase level 1, and no language at phase level 2, so racket/base must be explicitly required to give anything two `begin-for-syntax` levels in any meaning. But `compile` is not supposed to evaluate any code, it just compiles it. Which is why it fails to compile that code. But if you interleave it with evals, it will run the require code, which gives the phase level 2 code some meening. Does that make any sense, or was it too rambly. ~Leif Andersen On Mon, Dec 21, 2015 at 8:24 PM, Alex Knauth <alexan...@knauth.org> wrote: > I get that `compile` doesn't evaluate the require form, but why doesn't it > evaluate what's needed for compile time? I thought that was the reason for > needing require as a macro instead of a function. Or am I getting the purpose > of compile wrong? > > Alex Knauth > >> On Dec 21, 2015, at 7:47 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: >> >> In the REPL, `begin` splices at the granularity of expansion and >> evaluation. That is, the first of the two forms grouped by `begin` is >> compiled and evaluated, and only afterward the second one is compiled >> and evaluated. >> >> The `compile` function can't do that, because it's only supposed to >> compile -- not evaluate. >> >> The `syntax/toplevel` library provides >> >> expand-syntax-top-level-with-compile-time-evals >> >> as an intermediate point between those: it pulls apart `begin` and >> `expands` (which is the interesting part of `compile`) the forms in >> sequence, but it evaluates only compile-time parts of the given forms. >> That works for many cases, including your example. >> >> At Mon, 21 Dec 2015 17:35:22 -0700, Leif Andersen wrote: >>> So, I was under the impression that the REPL was the toplevel (unless >>> you entered a module context or something like that). But I just had >>> something challenge that assumption and so now I'm a bit confused. >>> >>> I have the following top level program: >>> >>> (begin >>> (require (for-meta 1 racket) >>> (for-meta 2 racket)) >>> (begin-for-syntax >>>(begin-for-syntax >>> (define x 5 >>> >>> When I run this top level program in the REPL, it works just fine. And >>> I can even reference x in later evaluations. (Provided I'm at the >>> meta-level of 2). >>> >>> However, when I pass this top level program into compile like so: >>> http://pasterack.org/pastes/38556 >>> >>> (compile #'(begin >>> (require (for-meta 1 racket) >>> (for-meta 2 racket)) >>> (begin-for-syntax >>> (begin-for-syntax >>> (define x 5) >>> >>> >>> I get the following error: >>> >>> define: unbound identifier at phase 2; >>> also, no #%app syntax transformer is bound in: define >>> >>> Can someone give me the reason (or at least some intuition) as to why >>> this works in the repl, but not at the top level? >>> >>> Thank you. >>> >>> ~Leif Andersen >>> >>> -- >>> 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. > -- 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] Confused about the difference between the REPL and the toplevel.
Wait, now I'm even more confused. If expand does the splicing and compile time evals song and dance, why do we need a separate function for: expand-syntax-top-level-with-compile-time-evals ? ~Leif Andersen On Mon, Dec 21, 2015 at 9:48 PM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > I believe that's because expand does the splicing dance, but compile > doesn't (which is why you need the funny-named function ... "need" is > perhaps a poor choice of words here :). > > Robby > > > On Mon, Dec 21, 2015 at 10:30 PM, Leif Andersen <l...@leifandersen.net> wrote: >> Ah, that's a good question. One that I don't really know the answer >> too, because when I do: >> >>> (compile #'(begin >>(define-syntax (foo stx) >> (displayln "hello") >> #'5) >>foo)) >> >> I get back the compiled object. Also foo is not displayed. And when I do: >> >> > (eval (compile #'(begin >>(define-syntax (foo stx) >> (displayln "hello") >> #'5) >>foo))) >> >> I get the error: >> >> foo: undefined; >> cannot reference an identifier before its definition >> >> But, when I do: >> >>> (expand #'(begin >>(define-syntax (foo stx) >> (displayln "hello") >> #'5) >> foo)) >> >> It displays 'hello' to the console. And expands to what I would expect it >> too. >> >> ~Leif Andersen >> >> >> On Mon, Dec 21, 2015 at 9:15 PM, Alex Knauth <alexan...@knauth.org> wrote: >>> >>>> On Dec 21, 2015, at 10:53 PM, Leif Andersen <l...@leifandersen.net> wrote: >>> >>>> But `compile` is not supposed to evaluate any code, it just compiles >>>> it. Which is why it fails to compile that code. But if you interleave >>>> it with evals, it will run the require code, which gives the phase >>>> level 2 code some meaning. >>> >>> I understand that `compile` isn't supposed to evaluate any _runtime_ code, >>> but I thought it had to evaluate the compile-time code for it to compile >>> the program? >>> >>> Am I misunderstanding what `compile` is supposed to do? Or what >>> compile-time code is, or? >>> >>>> Does that make any sense, or was it too rambly. >>>> >>>> ~Leif Andersen >>>> >>>> >>>> On Mon, Dec 21, 2015 at 8:24 PM, Alex Knauth <alexan...@knauth.org> wrote: >>>>> I get that `compile` doesn't evaluate the require form, but why doesn't >>>>> it evaluate what's needed for compile time? I thought that was the reason >>>>> for needing require as a macro instead of a function. Or am I getting the >>>>> purpose of compile wrong? >>>>> >>>>> Alex Knauth >>>>> >>>>>> On Dec 21, 2015, at 7:47 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: >>>>>> >>>>>> In the REPL, `begin` splices at the granularity of expansion and >>>>>> evaluation. That is, the first of the two forms grouped by `begin` is >>>>>> compiled and evaluated, and only afterward the second one is compiled >>>>>> and evaluated. >>>>>> >>>>>> The `compile` function can't do that, because it's only supposed to >>>>>> compile -- not evaluate. >>>>>> >>>>>> The `syntax/toplevel` library provides >>>>>> >>>>>> expand-syntax-top-level-with-compile-time-evals >>>>>> >>>>>> as an intermediate point between those: it pulls apart `begin` and >>>>>> `expands` (which is the interesting part of `compile`) the forms in >>>>>> sequence, but it evaluates only compile-time parts of the given forms. >>>>>> That works for many cases, including your example. >>>>>> >>>>>> At Mon, 21 Dec 2015 17:35:22 -0700, Leif Andersen wrote: >>>>>>> So, I was under the impression that the REPL was the toplevel (unless >>>>>>> you entered a module context or something like that). But I just had >>>>>>> something challenge that assumption and so now I'm a bit confused. >>>>>>> >>>>>>> I have the following top lev
[racket-users] Composing `splicing-let-syntax` with `prop:rename-transformer` and `module+` (or anything made with `syntax-local-lift-module-end-decloration`
Hello, I am noticing that if I in the body of splicing-let-syntax I put a module+, or anything that lifts with syntax-local-lift-module-end-decloration really, The stuff that gets lifted out doesn't seem to match what I would expect it to. I suspect this is in part do to using prop:rename-transformer, and mutable structs, but I don't want to use a syntax-parameter because I would like to parameterize over an identifier. Here is the code I have: #lang racket (require racket/splicing) (define-syntax (yellow stx) #'"yellow") (define-syntax (blue stx) #'"blue") (begin-for-syntax (struct stx-box (stx) #:mutable #:transparent #:property prop:rename-transformer (lambda (inst) (syntax-property (stx-box-stx inst) 'not-free-identifier=? #t (define-syntax (set-stx! stx) (syntax-case stx () [(_ box value) (begin (define-values (x y) (syntax-local-value/immediate #'box)) (set-stx-box-stx! x #'value) #'(void))])) (define-syntax x-top (stx-box #'yellow)) (define-syntax y-top 52) (splicing-let-syntax ([x (syntax-local-value #'x-top)]) (module+ test x)) (set-stx! x-top blue) (splicing-let-syntax ([x (syntax-local-value #'x-top)]) (module+ test x)) When I run it out I get: "yellow" "yellow" What I would like to get is: "yellow" "blue" Is there any better way to do this, and still have x be an identifier that is bound to the correct string? Thank you very much. ~Leif Andersen -- 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] Re: Composing `splicing-let-syntax` with `prop:rename-transformer` and `module+` (or anything made with `syntax-local-lift-module-end-decloration`
Also, I should point out that if I wasn't using module+, I get the expected output: "yellow" "blue" So I think it is due to the module+ macro pulling up the expression past the assignment. (This can be seen with the following code that is missing the module+ modules.) #lang racket (require racket/splicing) (define-syntax (yellow stx) #'"yellow") (define-syntax (blue stx) #'"blue") (begin-for-syntax (struct stx-box (stx) #:mutable #:transparent #:property prop:rename-transformer (lambda (inst) (syntax-property (stx-box-stx inst) 'not-free-identifier=? #t (define-syntax (set-stx! stx) (syntax-case stx () [(_ box value) (begin (define-values (x y) (syntax-local-value/immediate #'box)) (set-stx-box-stx! x #'value) #'(void))])) (define-syntax x-top (stx-box #'yellow)) (splicing-let-syntax ([x (syntax-local-value #'x-top)]) x) (set-stx! x-top blue) (splicing-let-syntax ([x (syntax-local-value #'x-top)]) x) ~Leif Andersen On Thu, Dec 17, 2015 at 3:08 PM, Leif Andersen <l...@leifandersen.net> wrote: > Hello, > > I am noticing that if I in the body of splicing-let-syntax I put a > module+, or anything that lifts with > syntax-local-lift-module-end-decloration really, The stuff that gets > lifted out doesn't seem to match what I would expect it to. I suspect > this is in part do to using prop:rename-transformer, and mutable > structs, but I don't want to use a syntax-parameter because I would > like to parameterize over an identifier. > > Here is the code I have: > > #lang racket > > (require racket/splicing) > > (define-syntax (yellow stx) #'"yellow") > (define-syntax (blue stx) #'"blue") > > (begin-for-syntax > (struct stx-box (stx) > #:mutable > #:transparent > #:property prop:rename-transformer > (lambda (inst) > (syntax-property (stx-box-stx inst) 'not-free-identifier=? #t > (define-syntax (set-stx! stx) > (syntax-case stx () > [(_ box value) > (begin >(define-values (x y) (syntax-local-value/immediate #'box)) >(set-stx-box-stx! x #'value) >#'(void))])) > > (define-syntax x-top (stx-box #'yellow)) > > (define-syntax y-top 52) > > (splicing-let-syntax ([x (syntax-local-value #'x-top)]) > (module+ test > x)) > > (set-stx! x-top blue) > > (splicing-let-syntax ([x (syntax-local-value #'x-top)]) > (module+ test > x)) > > When I run it out I get: > "yellow" > "yellow" > > What I would like to get is: > "yellow" > "blue" > > Is there any better way to do this, and still have x be an identifier > that is bound to the correct string? > > Thank you very much. > > ~Leif Andersen -- 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] Composing `splicing-let-syntax` with `prop:rename-transformer` and `module+` (or anything made with `syntax-local-lift-module-end-decloration`
Ah, okay, that makes sense, and fixed my issue. Thank you very much. ~Leif Andersen On Thu, Dec 17, 2015 at 4:13 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > A short answer: When compiling a submodule, as for any other module, > imported modules get fresh compile-time instantiations. It you want to > run effects from the enclosing module (which is an implicit import), > the effects must be in `begin-for-syntax`. > > > A long answer: > > When you write > > (module+ test ) > > then all of the `test` parts are assembled together at the end of the > enclosing module in a single `(module* test #f )` form. > > So, > > (define-syntax x-top (stx-box #'yellow)) > > (splicing-let-syntax ([x (syntax-local-value #'x-top)]) >(module+ test > x)) > > (set-stx! x-top blue) > > (splicing-let-syntax ([x (syntax-local-value #'x-top)]) >(module+ test > x)) > > is the same as > > (define-syntax x-top (stx-box #'yellow)) > > (define-syntax x1 (syntax-local-value #'x-top)) > > (set-stx! x-top blue) > > (define-syntax x2 (syntax-local-value #'x-top)) > > (module* test #f >x1 >x2) > > where `x1` and `x2` each stand for `x` with some distinct scope. > > > By the time the enclosing module is expanded, but before its submodules > are expanded, that becomes > > (define-syntax x-top (stx-box #'yellow)) > > (define-syntax x1 (syntax-local-value #'x-top)) > > (void) > > (define-syntax x2 (syntax-local-value #'x-top)) > > (module* test #f >x1 >x2) > > Note that the `(set-stx! )` form has been macro-expanded away. > > The process of expanding the `test` module then creates a new > compile-time instantiation of the enclosing module. Since the > `set-stx!` form has been expanded away to `(void)`, there's no change > to `x-top` during that instantiation. > > > Replace the definition of `set-stx!` with > > (define-syntax (set-stx! stx) >(syntax-case stx () > [(_ box value) > #'(begin-for-syntax > (define-values (x y) (syntax-local-value/immediate #'box)) > (set-stx-box-stx! x #'value))])) > > Now, the expansion of the outer module is > > (define-syntax x-top (stx-box #'yellow)) > > (define-syntax x1 (syntax-local-value #'x-top)]) > > (begin-for-syntax >(define-values (x y) (syntax-local-value/immediate #'x-top)) >(set-stx-box-stx! x #'blue)) > > (define-syntax x2 (syntax-local-value #'x-top)]) > > (module* test #f >x1 >x2) > > As usual (i.e., as in sense of "Composable and Compilable Macros"), > using `begin-for-syntax` preserves the effect for all future > compile-time instantiations of the enclosing module. That way, you get > "yellow" followed by "blue", as you wanted. > > > > At Thu, 17 Dec 2015 15:08:06 -0500, Leif Andersen wrote: >> Hello, >> >> I am noticing that if I in the body of splicing-let-syntax I put a >> module+, or anything that lifts with >> syntax-local-lift-module-end-decloration really, The stuff that gets >> lifted out doesn't seem to match what I would expect it to. I suspect >> this is in part do to using prop:rename-transformer, and mutable >> structs, but I don't want to use a syntax-parameter because I would >> like to parameterize over an identifier. >> >> Here is the code I have: >> >> #lang racket >> >> (require racket/splicing) >> >> (define-syntax (yellow stx) #'"yellow") >> (define-syntax (blue stx) #'"blue") >> >> (begin-for-syntax >> (struct stx-box (stx) >> #:mutable >> #:transparent >> #:property prop:rename-transformer >> (lambda (inst) >> (syntax-property (stx-box-stx inst) 'not-free-identifier=? #t >> (define-syntax (set-stx! stx) >> (syntax-case stx () >> [(_ box value) >> (begin >>(define-values (x y) (syntax-local-value/immediate #'box)) >>(set-stx-box-stx! x #'value) >>#'(void))])) >> >> (define-syntax x-top (stx-box #'yellow)) >> >> (define-syntax y-top 52) >> >> (splicing-let-syntax ([x (syntax-local-value #'x-top)]) >> (module+ test >> x)) >> >> (set-stx! x-top blue) >> >> (splicing-let-syntax ([x (syntax-local-value #'x-top)]) >> (module+ test >> x)) >> >> When I run it out I get: >> "yellow" >> "yellow" >> >> What I would like to get is: >> "yellow" >> "blue" >> >>
[racket-users] begin-for-syntax causes syntax objects to expand to a different #'quote
Hello, I am finding that when I have a syntax object: #'(begin-for-syntax (define-values (x) 5), when I expand it it becomes: #'(begin-for-syntax (define-values (x) '5). However, the quote in that expansion will not be free-identifier=? to the one if I were to type it out by hand: #'(begin-for-syntax (define-values (x) '5), and expand that. If however, I have a `begin` rather than a `begin-for-syntax`, giving me: #'(begin (define-values (x) 5) it works as expected. (The quote it expands into is free-identifier=? to the one that I am using.) I am calling expand (or expand-syntax) directly, and not really using any phase levels outside of whatever `expand` may use. Here is my code: http://pasterack.org/pastes/78711 #lang racket (define x (expand #'(begin-for-syntax (define-values (x) '5 (define y (expand #'(begin-for-syntax (define-values (x) 5 (define (ident=? stx) (syntax-case stx () [(_ (_ (_) (var _))) (free-identifier=? #'var #'quote)])) (syntax->datum x) (syntax->datum y) (ident=? x) (ident=? y) Is this expected behavior? If so, can you give me some intuition as to why? Thank you. ~Leif Andersen -- 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] begin-for-syntax causes syntax objects to expand to a different #'quote
Ah, cool. Thanks. Does that also mean that if I see a `syntax` form inside of a `begin-for-syntax` it goes back to phase 0? Thanks. ~Leif Andersen On Wed, Dec 16, 2015 at 6:25 PM, Sam Tobin-Hochstadt <sa...@cs.indiana.edu> wrote: > The identifiers are the same, but only when comparing their phase-1 > bindings. When doing traversal of syntax objects, you need to keep track of > the phase that identifiers are meaningful at. > > Here's a version of your paste comparing at the right phase: > http://pasterack.org/pastes/95574 > > Here's some quite complex code that walks fully-expanded syntax, and (I > think) handles phases right as of yesterday: > https://github.com/samth/pycket/blob/master/pycket/pycket-lang/expand.rkt . > See the `current-phase` parameter. > > Sam > > On Wed, Dec 16, 2015 at 6:22 PM Leif Andersen <l...@leifandersen.net> wrote: >> >> Hello, >> >> I am finding that when I have a syntax object: >> >> #'(begin-for-syntax (define-values (x) 5), when I expand it it becomes: >> #'(begin-for-syntax (define-values (x) '5). However, the quote in that >> expansion will not be free-identifier=? to the one if I were to type >> it out by hand: >> #'(begin-for-syntax (define-values (x) '5), and expand that. >> >> If however, I have a `begin` rather than a `begin-for-syntax`, giving me: >> #'(begin (define-values (x) 5) it works as expected. (The quote it >> expands into is free-identifier=? to the one that I am using.) >> >> I am calling expand (or expand-syntax) directly, and not really using >> any phase levels outside of whatever `expand` may use. >> >> Here is my code: http://pasterack.org/pastes/78711 >> >> #lang racket >> >> (define x (expand #'(begin-for-syntax >> (define-values (x) '5 >> (define y (expand #'(begin-for-syntax >> (define-values (x) 5 >> >> (define (ident=? stx) >> (syntax-case stx () >> [(_ (_ (_) (var _))) >> (free-identifier=? #'var #'quote)])) >> >> (syntax->datum x) >> (syntax->datum y) >> (ident=? x) >> (ident=? y) >> >> Is this expected behavior? If so, can you give me some intuition as to >> why? >> >> Thank you. >> >> ~Leif Andersen >> >> -- >> 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.
Re: [racket-users] begin-for-syntax causes syntax objects to expand to a different #'quote
Yeah, I would guess that too. Anyway, it doesn't seem to do all phases. So I just shift the phase down every time I see a begin-for-syntax. Thanks for your help. ~Leif Andersen On Wed, Dec 16, 2015 at 10:52 PM, Stephen Chang <stch...@ccs.neu.edu> wrote: > I'm not sure. I would guess that it corresponds to the label phase? > > On Wed, Dec 16, 2015 at 10:37 PM, Leif Andersen <l...@leifandersen.net> wrote: >> Ah, okay, thanks. One question, I notice that you can pass in #f to >> #:phase, I presume that is similar to for-label, can I use that to >> indicate I would like it to match on all phases? >> >> ~Leif Andersen >> >> >> On Wed, Dec 16, 2015 at 10:02 PM, Stephen Chang <stch...@ccs.neu.edu> wrote: >>> There's a #:phase option available when specifying literals: >>> >>> http://docs.racket-lang.org/syntax/Parsing_Syntax.html?q=syntax-parse#%28form._%28%28lib._syntax%2Fparse..rkt%29._syntax-parse%29%29 >>> >>> On Wed, Dec 16, 2015 at 9:55 PM, Leif Andersen <l...@leifandersen.net> >>> wrote: >>>> Okay, that makes sense, thanks. >>>> >>>> So out of curiosity, when doing a `syntax-parse`, is there any way I >>>> can pass in phase level 1 quote as a literal? >>>> >>>> ~Leif Andersen >>>> >>>> >>>> On Wed, Dec 16, 2015 at 6:44 PM, Sam Tobin-Hochstadt >>>> <sa...@cs.indiana.edu> wrote: >>>>> That depends on what you're trying to do, but probably not. Going under a >>>>> `quote-syntax` doesn't change things, it's just that those identifiers are >>>>> usually used in a macro somewhere else. But it would depend on your >>>>> application. >>>>> >>>>> Note the handling of submodules, though, in particular the call to >>>>> `syntax-shift-phase-level`. >>>>> >>>>> Sam >>>>> >>>>> On Wed, Dec 16, 2015 at 6:41 PM Leif Andersen <l...@leifandersen.net> >>>>> wrote: >>>>>> >>>>>> Ah, cool. Thanks. >>>>>> >>>>>> Does that also mean that if I see a `syntax` form inside of a >>>>>> `begin-for-syntax` it goes back to phase 0? >>>>>> >>>>>> Thanks. >>>>>> >>>>>> ~Leif Andersen >>>>>> >>>>>> >>>>>> On Wed, Dec 16, 2015 at 6:25 PM, Sam Tobin-Hochstadt >>>>>> <sa...@cs.indiana.edu> wrote: >>>>>> > The identifiers are the same, but only when comparing their phase-1 >>>>>> > bindings. When doing traversal of syntax objects, you need to keep >>>>>> > track >>>>>> > of >>>>>> > the phase that identifiers are meaningful at. >>>>>> > >>>>>> > Here's a version of your paste comparing at the right phase: >>>>>> > http://pasterack.org/pastes/95574 >>>>>> > >>>>>> > Here's some quite complex code that walks fully-expanded syntax, and (I >>>>>> > think) handles phases right as of yesterday: >>>>>> > >>>>>> > https://github.com/samth/pycket/blob/master/pycket/pycket-lang/expand.rkt >>>>>> > . >>>>>> > See the `current-phase` parameter. >>>>>> > >>>>>> > Sam >>>>>> > >>>>>> > On Wed, Dec 16, 2015 at 6:22 PM Leif Andersen <l...@leifandersen.net> >>>>>> > wrote: >>>>>> >> >>>>>> >> Hello, >>>>>> >> >>>>>> >> I am finding that when I have a syntax object: >>>>>> >> >>>>>> >> #'(begin-for-syntax (define-values (x) 5), when I expand it it >>>>>> >> becomes: >>>>>> >> #'(begin-for-syntax (define-values (x) '5). However, the quote in that >>>>>> >> expansion will not be free-identifier=? to the one if I were to type >>>>>> >> it out by hand: >>>>>> >> #'(begin-for-syntax (define-values (x) '5), and expand that. >>>>>> >> >>>>>> >> If however, I have a `begin` rather than a `begin-for-syntax`, giving >>>>>> >> me: >>>>>> >> #'(begin (define-values (x) 5) it works as expected. (The quote it >>&g
Re: [racket-users] racket users fight for their right to colon keywords
So, I thought about doing that. Except that I ended up not, because voting 5/5/0 doesn't properly capture my feelings. 5/5/0 seems more like a, I see pros and cons with both sides, but I fundamentally care some way or the other which way this goes. My opinion really is that this is a silly issue, and doesn't really matter that much to me at all. And thus I don't really care either way. I would vote on the 0 for the last question, (just because meh, I don't care one way or the other), but I really didn't fit anywhere on the spectrum for the first two boxes. Does that clarify my opinion a bit? ~Leif Andersen On Thu, Oct 22, 2015 at 1:53 PM, Jay McCarthy <jay.mccar...@gmail.com> wrote: > On Thu, Oct 22, 2015 at 1:49 PM, Leif Andersen <l...@leifandersen.net> > wrote: > >> > I am genuinely surprised :keyword saw so much support and that change >> was so attractive to people. >> >> That's because of the questions you asked. I saw those questions and said >> to myself: "Self, I don't care enough about this debate enough to even >> really fill out these questions." (Although if you had a spot on the pull >> for the question: "I don't care about this at all, just don't break my >> code", I would have filled that out.) >> > > I'm interested in your elaboration. I expected someone with your opinion > to vote something like 5/5/0 because you don't care between the two, but > don't want a change. > > Jay > > >> >> >> >> ~Leif Andersen >> >> On Thu, Oct 22, 2015 at 1:43 PM, Jay McCarthy <jay.mccar...@gmail.com> >> wrote: >> >>> It has been a little more than a week and we've stopped getting results. >>> >>> The full results should be publicly available. Here is a summary: >>> >>> >>> https://docs.google.com/forms/d/1HSwtxLhz5HWGMJjMXaO8LQyHJsdMkGbBlRa4fU7Sa34/viewanalytics >>> >>> and here is the raw data: >>> >>> >>> https://docs.google.com/spreadsheets/d/1rZNNGwupMZTybxKRhukLdgA8VIA8oPlQ7nPk8Gv52Es/edit#gid=348615477 >>> >>> My interpretation of the data is as follows: >>> >>> - The #:keyword syntax is liked fine with a rating of 5.67 >>> - The :keyword syntax is more loved with a rating of 6.9 >>> - But change is not popular, average of 5.1 with high standard deviation >>> - People that really like #:keyword do not want a change and do not like >>> :keyword >>> - People that really like :keyword want a change >>> >>> I am genuinely surprised :keyword saw so much support and that change >>> was so attractive to people. >>> >>> Naturally whenever you do stuff like this, you want to ask more >>> questions, like what about keyword:, what about supporting both, etc. >>> >>> Jay >>> >>> >>> On Wed, Oct 14, 2015 at 11:50 AM, Neil Van Dyke <n...@neilvandyke.org> >>> wrote: >>> >>>> We are conducting a highly scientific poll. >>>> >>>> The question we want to answer is whether people would like for the >>>> Racket standard languages to have symbols that begin with the colon >>>> character (except for the symbol `:`) to read the same has keywords that >>>> begin with pound-colon. >>>> >>>> That is, when this glorious colon-keywords support is added, instead of >>>> having to type and look at: >>>> >>>> (foo #:abc 1 #:xyx 42) >>>> >>>> you can choose to bask in the beauty of: >>>> >>>> (foo :abc 1 :xyx 42) >>>> >>>> Then you would be free to use the gorgeous colon-keywords everywhere in >>>> Racket, including in quick one-line examples in email list posts. >>>> >>>> All people of great aesthetic sense, intellect, and good moral fiber, >>>> who would naturally like everyone to have the right to use either >>>> colon-keywords or (eww) pound-colon keywords (in unity, and without >>>> unnecessary `#lang` schisms!), should answer the quick poll: >>>> >>>> http://goo.gl/forms/Kwl3uZVMsb >>>> >>>> (When the poll question asks "Is it worth changing?", read it is as >>>> "You are a good person, and you naturally think Racket should support both >>>> colon-keywords and pound-colon keywords, right?") >>>> >>>> I call upon all freedom-loving Racketeers to stand up and fight for the >>>> righteous cause of colon-keywords. The moment to answer this highly
Re: [racket-users] racket users fight for their right to colon keywords
> I am genuinely surprised :keyword saw so much support and that change was so attractive to people. That's because of the questions you asked. I saw those questions and said to myself: "Self, I don't care enough about this debate enough to even really fill out these questions." (Although if you had a spot on the pull for the question: "I don't care about this at all, just don't break my code", I would have filled that out.) ~Leif Andersen On Thu, Oct 22, 2015 at 1:43 PM, Jay McCarthy <jay.mccar...@gmail.com> wrote: > It has been a little more than a week and we've stopped getting results. > > The full results should be publicly available. Here is a summary: > > > https://docs.google.com/forms/d/1HSwtxLhz5HWGMJjMXaO8LQyHJsdMkGbBlRa4fU7Sa34/viewanalytics > > and here is the raw data: > > > https://docs.google.com/spreadsheets/d/1rZNNGwupMZTybxKRhukLdgA8VIA8oPlQ7nPk8Gv52Es/edit#gid=348615477 > > My interpretation of the data is as follows: > > - The #:keyword syntax is liked fine with a rating of 5.67 > - The :keyword syntax is more loved with a rating of 6.9 > - But change is not popular, average of 5.1 with high standard deviation > - People that really like #:keyword do not want a change and do not like > :keyword > - People that really like :keyword want a change > > I am genuinely surprised :keyword saw so much support and that change was > so attractive to people. > > Naturally whenever you do stuff like this, you want to ask more questions, > like what about keyword:, what about supporting both, etc. > > Jay > > > On Wed, Oct 14, 2015 at 11:50 AM, Neil Van Dyke <n...@neilvandyke.org> > wrote: > >> We are conducting a highly scientific poll. >> >> The question we want to answer is whether people would like for the >> Racket standard languages to have symbols that begin with the colon >> character (except for the symbol `:`) to read the same has keywords that >> begin with pound-colon. >> >> That is, when this glorious colon-keywords support is added, instead of >> having to type and look at: >> >> (foo #:abc 1 #:xyx 42) >> >> you can choose to bask in the beauty of: >> >> (foo :abc 1 :xyx 42) >> >> Then you would be free to use the gorgeous colon-keywords everywhere in >> Racket, including in quick one-line examples in email list posts. >> >> All people of great aesthetic sense, intellect, and good moral fiber, who >> would naturally like everyone to have the right to use either >> colon-keywords or (eww) pound-colon keywords (in unity, and without >> unnecessary `#lang` schisms!), should answer the quick poll: >> >> http://goo.gl/forms/Kwl3uZVMsb >> >> (When the poll question asks "Is it worth changing?", read it is as "You >> are a good person, and you naturally think Racket should support both >> colon-keywords and pound-colon keywords, right?") >> >> I call upon all freedom-loving Racketeers to stand up and fight for the >> righteous cause of colon-keywords. The moment to answer this highly >> scientific poll is now. >> >> Neil V. >> >> -- >> 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.
Re: [racket-users] Expression context
Oh cool, I didn't know that existed. Thanks for sharing. ~Leif Andersen On Tue, Sep 15, 2015 at 12:37 AM, Jens Axel Søgaard <jensa...@soegaard.net> wrote: > FWIW an alternative to (let () ...) is block. > > http://docs.racket-lang.org/reference/block.html?q=block > > 2015-09-15 0:16 GMT+02:00 John Carmack <jo...@oculus.com>: > >> Is there a deep reason why defines aren’t allowed in the branches of an >> if, but are for cond / while / unless? >> >> >> >> Wrapping code in (let() …) instead of (begin …) works fine, but it is a >> strange quirk to explain to someone else. >> >> >> >> -- >> 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. >> > > > > -- > -- > Jens Axel Søgaard > > -- > 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.
Re: [racket-users] Expression context
> Wrapping code in (let() …) instead of (begin …) works fine, but it is a strange quirk to explain to someone else. This is because begin actually does not create new scope in racket, where as (let () ...) does. Consider the following code: #lang racket (define (f x) (begin (define g 5)) (+ x g)) (f 6) ; => 11 Here, g is still in scope, despite it being defined in a begin. If it was changed to a (let () ...) then the code would error. The reason it doesn't make sense to allow for sequencing statements in an if block is a matter of binding. Consider the following expression: (if #f (begin (define x 5) x) 12)) (displaln x) ; ??? Should x be bound outside the if? There are a few ways to get around this. The first would be to make if forms create new scope in it's then and else clauses. This is what when and unless do, and why you can use define in it. If you want to do this you could with a macro: (define-syntax-rule (my-if condition then else) (if condition (let () then) (let () else))) (my-if #f (begin (define x 5) x) 12) Another is to use a form that creates new scope. (let () ...) does this, but if you find (let () ...) unappealing, you can create a macro to get rid of it. (define-syntax-rule (new-scope . body) (let () . body)) (if #f (new-scope (define x 5) x) 12) I hope that makes it more clear why you can use let but not begin to define variables in an if. ~Leif Andersen On Mon, Sep 14, 2015 at 6:24 PM, Matthias Felleisen <matth...@ccs.neu.edu> wrote: > > On Sep 14, 2015, at 6:16 PM, John Carmack <jo...@oculus.com> wrote: > > > Is there a deep reason why defines aren’t allowed in the branches of an > if, but are for cond / while / unless? > > > > Wrapping code in (let() …) instead of (begin …) works fine, but it is a > strange quirk to explain to someone else. > > > It exposes our history. Traditionally there are no extra markers in > LISP-style syntax to introduce phrases within a grammatical sentence. Thus, > an if-expression obeys the grammar > > (if test-expression > then-expression > else-expression) > > not an Algol-style variant with additional keywords: > > (if test-expression > #:then then-expression > #:else else-expression) > > If we had those markers (not just in if-expressions but wherever we may > allow sequences of expressions), we could mixin definitions wherever we > wanted. > > In cond, it is obvious which phrase is a branch (due to the > parentheses/brackets) and that the first part of each branch is a > test-expression. The extra pair of parens play the role of Algol-style > markers. > > Now, if Racket had emerged as an alternative attempt to address all of > Lisp's weaknesses, we might have overcome this problem, too. But Racket > grew organically and we value backward compatibility very highly for our > programmers. You might say we are the C++ of the LISP world, but I hope we > can do better in the long run. > > -- Matthias > > -- > 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.
Re: [racket-users] pkg version exceptions: ranges of versions?
In that case is it possible to have a version for HEAD, or at least the latest nightlies, as those version numbers tend to change quite rapidly? ~Leif Andersen On Mon, Aug 17, 2015 at 10:47 AM, Jay McCarthy jay.mccar...@gmail.com wrote: This is not currently a feature. Jay On Sun, Aug 16, 2015 at 11:09 AM, Alexander D. Knauth alexan...@knauth.org wrote: Is there a way to create a version exception for a range of versions, instead of for a single version? -- 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 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. - DC 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.
Re: [racket-users] How to use new 6.2.1 feature for true instead of #true, etc. ?
You can copy your DrRacket preferences file to the defaults collection. There is some documentation on this here: http://docs.racket-lang.org/drracket/drracket-files.html?q=Preference%20Files#%28part._.Preference_.Files%29 ~Leif Andersen On Wed, Aug 12, 2015 at 9:14 AM, Charles Rich r...@wpi.edu wrote: Hi Matthias, Thanks for the quick reply. We're installing this on all teaching lab and campus machines for students in our courses. Is there any way to make true, etc., the default, so students don't have to make this change every time the start up Racket? -Chuck On Wed, Aug 12, 2015 at 8:51 AM, Matthias Felleisen matth...@ccs.neu.edu wrote: Open the language dialogue. Click 'choose details'. On the right side, you will see a radio button for true/false/empty vs #true/#false/'(). On Aug 12, 2015, at 8:43 AM, Charles Rich wrote: Hi, in the release notes for 6.2.1 it says: * For the How to Design Programs teaching languages, DrRacket offers an option to use the old style for printing the constants `true`, `false`, and `empty` instead of `#true`, `#false`, and `'()`. But after searching a while, I could not find out how to do this. It would be a good idea to add a hyperlink to the release notes. Thanks, -Chuck -- 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. -- Dr. Charles Rich, Professor, Computer Science Department http://www.cs.wpi.edu Interactive Media and Game Development Program http://www.wpi.edu/academics/imgd/ Robotics Engineering Program http://www.wpi.edu/academics/robotics/ Worcester Polytechnic Institute, Fuller Laboratories B25b 100 Institute Road, Worcester, MA 01609-2280 Email: r...@wpi.edu Phone: 508-831-5945 Fax: 508-831-5776 Home: http://www.cs.wpi.edu/~rich -- 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.
Re: [racket-users] sub-range-binders
So then, out of curiosity, how does it do this for structs? (I thought it was using sub-range-binders there.) For example: If I have the program: #lang racket (struct foo (bar)) (define x (foo 2)) (foo-bar x) I can use the rename tool to rename bar to baz and get: #lang racket (struct foo (bar)) (define x (foo 2)) (foo-bar x) ~Leif Andersen On Wed, Jul 15, 2015 at 3:48 PM, Robby Findler ro...@eecs.northwestern.edu wrote: No, I don't think that this can be made to work with the current sub-range-binders. The way DrRacket thinks about this is that those are two different binders (symb and symb?), and you are renaming either one of them or the other one. It can't connect them the way you are seeming to want to connect them (if I'm understanding correctly?). Robby On Tue, Jul 14, 2015 at 11:50 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Hi All, I am experimenting with the sub-range-binders syntax property. Given this program: (define symb? symbol?) (define-no? symb?) symb I want to use DrRacket's renaming facility to rename the symb? in the second line to sym?. I expect to get this program: (define sym? symbol?) (define-no? sym?) sym However I get this: (define sym? symbol?) (define-no? sym?) sym? (notice the extra ? in the last line). Is this possible using sub-range-binders ? /Jens Axel #lang racket/base (require (for-syntax racket/base)) (define-syntax (define-no? stx) (syntax-case stx () [(_ id?) (let () (define s (symbol-string (syntax-e #'id?))) (define l1 (string-length s)) (define l2 (- l1 1)) (define id-str (substring s 0 l2)) (define id (datum-syntax #'id? (string-symbol id-str))) (syntax-property #`(define #,id id?) 'sub-range-binders (vector (syntax-local-introduce id) 0 l2 0.5 0.5 (syntax-local-introduce #'id?) 0 l1 0.5 0.5)))])) (define symb? symbol?) (define-no? symb?) symb -- 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. -- 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] sub-range-binders
Oh, okay, that makes complete sense. Thanks. ~Leif Andersen On Wed, Jul 15, 2015 at 4:24 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Oh, I understand Jens Axel to be doing something more subtle than that. In particular, in his example check syntax sees two distinct identifiers (sym and sym?) that have overlapping ranges. When you rename one, it just renames that one and hopes for the best. (Well, to see what it actually does, you'll want to look at the code.) With define-struct, the sub identifiers don't actually overlap, their ranges are always disjoint. I'm not opposed to changing its behavior for the overlapping case if there is a more sensible thing to do. Hopefully suggestions wil be made in the form of pull requests with test suites, tho :) Robby On Wed, Jul 15, 2015 at 3:03 PM, Leif Andersen l...@leifandersen.net wrote: So then, out of curiosity, how does it do this for structs? (I thought it was using sub-range-binders there.) For example: If I have the program: #lang racket (struct foo (bar)) (define x (foo 2)) (foo-bar x) I can use the rename tool to rename bar to baz and get: #lang racket (struct foo (bar)) (define x (foo 2)) (foo-bar x) ~Leif Andersen On Wed, Jul 15, 2015 at 3:48 PM, Robby Findler ro...@eecs.northwestern.edu wrote: No, I don't think that this can be made to work with the current sub-range-binders. The way DrRacket thinks about this is that those are two different binders (symb and symb?), and you are renaming either one of them or the other one. It can't connect them the way you are seeming to want to connect them (if I'm understanding correctly?). Robby On Tue, Jul 14, 2015 at 11:50 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Hi All, I am experimenting with the sub-range-binders syntax property. Given this program: (define symb? symbol?) (define-no? symb?) symb I want to use DrRacket's renaming facility to rename the symb? in the second line to sym?. I expect to get this program: (define sym? symbol?) (define-no? sym?) sym However I get this: (define sym? symbol?) (define-no? sym?) sym? (notice the extra ? in the last line). Is this possible using sub-range-binders ? /Jens Axel #lang racket/base (require (for-syntax racket/base)) (define-syntax (define-no? stx) (syntax-case stx () [(_ id?) (let () (define s (symbol-string (syntax-e #'id?))) (define l1 (string-length s)) (define l2 (- l1 1)) (define id-str (substring s 0 l2)) (define id (datum-syntax #'id? (string-symbol id-str))) (syntax-property #`(define #,id id?) 'sub-range-binders (vector (syntax-local-introduce id) 0 l2 0.5 0.5 (syntax-local-introduce #'id?) 0 l1 0.5 0.5)))])) (define symb? symbol?) (define-no? symb?) symb -- 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. -- 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]
Hello All, Due to licensing concerns with using GNU's libreadline library for the readline collection, we are switching the library to libedit. This should not affect most people as libedit is included with OS X and most Linux distributions (and Windows never had libreadline to begin with). The readline collection is what xrepl uses for command line REPL editing. libedit provides most of the same features as libreadline. Although there will be some features missing (such as Ctr+R search). If you wish to go back to using GNU's libreadline for the readline collection, you can do so by installing the readline-gpl package (which will not be bundled with racket, but can be downloaded from the package server with): raco pkg install readline-gpl Let me know if you have any questions or concerns. ~Leif Andersen -- 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] Typed analog of integer-in contract
You could use a union type, but I’m not sure if a large union type would work well in terms of performance? I don't think this will work. This takes a long time to run (although I'm not sure how much of this is the macro expansion). Anyway, if it takes this long on a union type with 1 things in it, I highly doubt it can support a union type with over a million. #lang typed/racket (require (for-syntax syntax/parse racket/list)) (define-syntax (define-range stx) (syntax-parse stx [(_ name range-low range-hi) #`(define-type name (U #,@(range (syntax-e #'range-low) (syntax-e #'range-hi])) (define-range hello 0 1) ~Leif Andersen On Tue, Apr 21, 2015 at 10:41 AM, Matthias Felleisen matth...@ccs.neu.edu wrote: #lang typed/racket (define-type NDigit (U 0 1 2 3 4 5 6 7 8 9)) (define-type SDigit (U 'zero 'one 'two 'three 'four 'five 'six 'seven 'eight 'nine)) (: to-string (- NDigit SDigit)) (define (to-string i) (case i [(0) (displayln i) 'zero] [(1) (displayln i) 'zero] [(2) (displayln i) 'zero] [(3) (displayln i) 'zero] [(4) (displayln i) 'zero] [(5) (displayln i) 'zero] [(6) (displayln i) 'zero] [(7) (displayln i) 'zero] [(8) (displayln i) 'zero] [(9) (displayln i) 'zero] ;; can't get here [else (displayln (+ i i)) 'one])) I wish mousing over i would give me more precise types here. Occurrence typing subtracts 2 ... from i's type but somehow it doesn't work thru case. On Apr 20, 2015, at 9:09 PM, Benjamin Greenman wrote: The contract integer-in lets me guarantee an integer is within a certain range. (define/contract (mod3 n) (- integer? (integer-in 0 2)) (modulo n 3)) Is there a similar way to specify a type for an integer range? Or do I need to use a union type? (I'd really like to specify a range containing over a million integers.) -- 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. -- 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] (require plot) categorically requires X11
Hello, You can always use the plot/no-gui collection: http://docs.racket-lang.org/plot/plotting.html?q=plot%2Fno-gui#%28mod-path._plot%2Fno-gui%29 This should work without the need for X11. On Sat, Apr 11, 2015 at 4:16 AM, Dmitry Pavlov dpav...@ipa.nw.ru wrote: Hello, I try to require the plotting library (let alone use it) in a non-X Linux session: $ ssh localhost $ racket Welcome to Racket v6.1.1.8. (require plot) Gtk initialization failed for display :0 context...: /opt/racket/share/pkgs/gui-lib/mred/private/wx/gtk/queue.rkt: [running body] /opt/racket/share/pkgs/gui-lib/mred/private/wx/gtk/init.rkt: [traversing imports] /opt/racket/share/pkgs/gui-lib/mred/private/wx/gtk/platform.rkt: [traversing imports] /opt/racket/share/pkgs/gui-lib/mred/private/wx/platform.rkt: [running body] /opt/racket/share/pkgs/gui-lib/racket/gui/base.rkt: [traversing imports] To me, it does seem like an over-requirement. Is X11 really needed in a non-graphical Racket prompt? What X11 is available, (plot) calls run without complaints and result into some (object:2d-plot-snip% ...) notation shown in the console (so no real X11 usage still). Anyway, what if I just want to plot into a file? Best regards, Dmitry -- 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.