Re: [racket-dev] [plt] Push #23408: master branch updated
8 hours ago, Sam Tobin-Hochstadt wrote: > On Wed, Aug 31, 2011 at 1:51 PM, Eli Barzilay wrote: > > An hour ago, sa...@racket-lang.org wrote: > >> +Modified to use `syntax-parse' and multiple macros by Sam > >> +Tobin-Hochstadt, 2011. > > > > AFAICT, you're not using anything that `synatx-rules' can't do, so > > what's the point? > > Better error messages, hopefully. Um, but you didn't do that: -> ,r srfi/11 -> (let-values ([(x x) 1]) 2) ; readline-input:4:17: let: duplicate identifier at: x in: (let ((x x) (x x)) ; (begin 2)) [,bt for context] -> (let-values ([(x 1) 1]) 2) ; readline-input:5:17: let: bad syntax (not an identifier) at: 1 in: (let ((x ; x) (1 x)) (begin 2)) [,bt for context] -> (let-values ([(x 1) 2 3]) 2) ; readline-input:6:22: let-values/bind: unexpected term at: 3 in: ; (let-values/bind (((x 1) 2 3)) () (begin 2)) [,bt for context] -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] drRacket Close/Close tab
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/31/11 20:11, Eli Barzilay wrote: > 6 hours ago, Sam Tobin-Hochstadt wrote: >> The other three applications (Pidgin, Epiphany, Gedit) all >> follow the behavior described in the HIG: there is only a Close >> menu entry (no Close Tab), it closes the current tab, and its >> shortcut is Ctrl-w. >> >> I think we should follow the platform guidelines here as well, >> and do the same. > > I prefer that the above (a single "Close" entry that closes the > current tab or the current window) be used everywhere, including > on OSX. > > 1. It's as important as the Run button, which already steps over > the well-used `C-t', which is *so* confusing[*] that not having > two distinct menu entries for close/close-all seems extremely minor > in comparison. > > [*] Confusing enough that I keep tripping over it in class, > hitting C-t a few times and realize the mistake. It's even worse > in making me use C-= in my browser later in an attempt to create a > new tab. This is a mess that I think is better to address than > keeping C-t for backward compatibility. I concur with Eli completely. Given that Ctrl+R is currently bound to ``Replace'' which is disabled by default (!) it seems silly not to bind it to Run (which apparently is important enough to have its own button). Marijn -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEUEARECAAYFAk5fQNwACgkQp/VmCx0OL2zjRwCgoqe68NzyJ5w3gRCyoUEPPluP A+UAl2izKs/lM46vf9ZW2VwxAAosVeI= =vsqY -END PGP SIGNATURE- _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
[racket-dev] list-box% not properly sized
Hi list, list-box%es are not properly sized; the following code: #lang racket/gui (define root (new frame% (label "choice widgets"))) (define list-box (new list-box% (parent root) (label "List-box: ") (style '(multiple)) (choices '("1" "b" "C3" "44" "five" "6" "seven" "OO" (send root show #t) results in the attached screenshot. Marijn <> signature.asc Description: OpenPGP digital signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
[racket-dev] editor-canvas% not visually distinguished
Hi list, on GTK, editor-canvas%es are not visually distinguished, like text-field%s are, to indicate that it is possible to enter text; the following code: #lang racket/gui (define root (new frame% (label "test"))) (new text-field% (parent root) (label "Input: ")) (define text (new text%)) (new editor-canvas% (parent root) (editor text) (min-width 40) (min-height 50)) (send root show #t) produces the attached screenshot on my system, Marijn <> signature.asc Description: OpenPGP digital signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] online check syntax deadlock: can you help?
> Is that expected? It looks like the OS is preventing > not-full-fledged-app-things from opening windows and handling input. > This is OS 10.6,8. It probably needs to run from inside the .app folder. OS X uses the full path to the binary to figure out the name to use to dispatch events, or something similarly odd! I've tried a couple of quick experiments along the lines of $ /Applications/Racket v5.1.3/DrRacket.app/Contents/MacOS/DrRacket -W info -l- drracket but that binary doesn't like the -W switch. [...] Aha, removing the DrRacket binary from the Contents/MacOS directory and symlinking plain racket there as DrRacket instead works for me: $ mv DrRacket DrRacket.moved-out-of-the-way $ ln -s /Applications/Racket\ v5.1.3/bin/racket DrRacket $ /Applications/Racket v5.1.3/DrRacket.app/Contents/MacOS/DrRacket -W info -l- drracket I launch that all from an xterm in X11, though, so if it doesn't work for you that's an interesting clue that Terminal.app is doing something weird perhaps. Regards, Tony _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] [plt] Push #23408: master branch updated
On Thu, Sep 1, 2011 at 3:13 AM, Eli Barzilay wrote: > 8 hours ago, Sam Tobin-Hochstadt wrote: >> On Wed, Aug 31, 2011 at 1:51 PM, Eli Barzilay wrote: >> > An hour ago, sa...@racket-lang.org wrote: >> >> +Modified to use `syntax-parse' and multiple macros by Sam >> >> +Tobin-Hochstadt, 2011. >> > >> > AFAICT, you're not using anything that `synatx-rules' can't do, so >> > what's the point? >> >> Better error messages, hopefully. > > Um, but you didn't do that: Indeed, the error messages could be improved in lots of ways -- I just took the reference implementation and improved it in the most obvious ways. I had hoped that things like the following would get better errors from `syntax-parse' automatically: -> (let-values) -> (let-values 3 4 5 6) -> (let-values (3 . 4) 3 4 5) But they didn't, unfortunately. I don't know if Ryan will change that ever. If there was something between `syntax-parser' and `define-simple-macro', that would be the right tool here. -- sam th sa...@ccs.neu.edu _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] online check syntax deadlock: can you help?
At Wed, 31 Aug 2011 23:00:25 -0700, John Clements wrote: > > On Aug 31, 2011, at 5:08 PM, Robby Findler wrote: > > > I've been seeing for some time now a deadlock in online check syntax. > > That is, after a while it just gets stuck and fails to complete the > > online check syntax. Typically what you see is the little blue dot > > come on but the cpu load drop to zero without any check syntax arrows > > ever showing up. > > > > Matthew and I have fixed a few things that could lead to these > > symptoms and I've just now pushed a change to compiler/cm to add some > > more informative logging. > > > > So: if you have the energy, can you please run DrRacket like this: > > > > racket -W info -l- drracket > > This doesn't work at all for me on the Mac, and highlights a problem that > I've > had at other times with racket & GUI frames: none of the keyboard input goes > to the window. > > Specifically, here's the sequence of events: > > 1) run racket -W info -l- drracket > 2) See splash window come up, *underneath* terminal window and not given > focus. > 3) See DrRacket frame come up, again without focus. > 4) Click on DrRacket frame, it gets focus and I see the cursor blinking. > 5) Type a few characters -- they don't show up in DrRacket. Instead, they go > to the terminal window. > Furthermore, there's no DrRacket menu bar, and no DrRacket icon in the > cmd-tab > list. > > 6) Go back to terminal window, use ctrl-\ to blow it away. > > Is that expected? It looks like the OS is preventing > not-full-fledged-app-things from opening windows and handling input. This is > OS 10.6,8. The code that is supposed to make the process a full-fledged app is line at line 81 of "collects/mred/private/cocoa/queue.rkt": ;; In case we were started in an executable without a bundle, ;; explicitly register with the dock so the application can receive ;; keyboard events. (define-cstruct _ProcessSerialNumber ([highLongOfPSN _ulong] [lowLongOfPSN _ulong])) (define kCurrentProcess 2) (define kProcessTransformToForegroundApplication 1) (define-appserv TransformProcessType (_fun _ProcessSerialNumber-pointer _uint32 -> _OSStatus)) (void (TransformProcessType (make-ProcessSerialNumber 0 kCurrentProcess) kProcessTransformToForegroundApplication)) Note that the code ignores the result of `TransformProcessType', which is a bad idea. If you remove the `void' wrapper, what number result gets printed on your machine? _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] editor-canvas% not visually distinguished
The intent is that the 'control-border style for `editor-canvas%' gives it a border like a control. The default mode is suitable for an editor that fills a window. Canvas border styles didn't work on Gtk when the canvas has a scroll bar, though, so I've pushed a repair for that bug. At Thu, 01 Sep 2011 10:49:22 +0200, Marijn wrote: > Hi list, > > on GTK, editor-canvas%es are not visually distinguished, like > text-field%s are, to indicate that it is possible to enter text; the > following code: > > > > #lang racket/gui > > (define root (new frame% (label "test"))) > > (new text-field% (parent root) (label "Input: ")) > > (define text (new text%)) > > (new editor-canvas% (parent root) (editor text) (min-width 40) > (min-height 50)) > > (send root show #t) > > > > produces the attached screenshot on my system, > > Marijn _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] online check syntax deadlock: can you help?
[[ FWIW, I have been running drracket like this for a couple of weeks and have had no problem. Mac OS X 10.6.8 ]] On Sep 1, 2011, at 8:34 AM, Matthew Flatt wrote: > At Wed, 31 Aug 2011 23:00:25 -0700, John Clements wrote: >> >> On Aug 31, 2011, at 5:08 PM, Robby Findler wrote: >> >>> I've been seeing for some time now a deadlock in online check syntax. >>> That is, after a while it just gets stuck and fails to complete the >>> online check syntax. Typically what you see is the little blue dot >>> come on but the cpu load drop to zero without any check syntax arrows >>> ever showing up. >>> >>> Matthew and I have fixed a few things that could lead to these >>> symptoms and I've just now pushed a change to compiler/cm to add some >>> more informative logging. >>> >>> So: if you have the energy, can you please run DrRacket like this: >>> >>> racket -W info -l- drracket >> >> This doesn't work at all for me on the Mac, and highlights a problem that >> I've >> had at other times with racket & GUI frames: none of the keyboard input goes >> to the window. >> >> Specifically, here's the sequence of events: >> >> 1) run racket -W info -l- drracket >> 2) See splash window come up, *underneath* terminal window and not given >> focus. >> 3) See DrRacket frame come up, again without focus. >> 4) Click on DrRacket frame, it gets focus and I see the cursor blinking. >> 5) Type a few characters -- they don't show up in DrRacket. Instead, they go >> to the terminal window. >> Furthermore, there's no DrRacket menu bar, and no DrRacket icon in the >> cmd-tab >> list. >> >> 6) Go back to terminal window, use ctrl-\ to blow it away. >> >> Is that expected? It looks like the OS is preventing >> not-full-fledged-app-things from opening windows and handling input. This is >> OS 10.6,8. > > The code that is supposed to make the process a full-fledged app is > line at line 81 of "collects/mred/private/cocoa/queue.rkt": > > ;; In case we were started in an executable without a bundle, > ;; explicitly register with the dock so the application can receive > ;; keyboard events. > (define-cstruct _ProcessSerialNumber > ([highLongOfPSN _ulong] >[lowLongOfPSN _ulong])) > (define kCurrentProcess 2) > (define kProcessTransformToForegroundApplication 1) > (define-appserv TransformProcessType (_fun _ProcessSerialNumber-pointer >_uint32 >-> _OSStatus)) > (void (TransformProcessType (make-ProcessSerialNumber 0 kCurrentProcess) > kProcessTransformToForegroundApplication)) > > Note that the code ignores the result of `TransformProcessType', which > is a bad idea. If you remove the `void' wrapper, what number result > gets printed on your machine? > > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/dev _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] drRacket Close/Close tab
On Wed, Aug 31, 2011 at 3:30 AM, Marijn wrote: >> I like the idea of adding shift, but I've changed things so that >> instead of the w shortcut going away, the close menu item becomes >> -shift-w (so the shifting behavior is still there and we >> are complying with the guidelines in the no-tabs case). > > On Gtk nothing has changed for me. > I've managed to get my ubuntu 10.04.1 vm back in shape and rebuild drracket there and the various keybindings and menu items seem to shift around as expected. I've put a screenshot here to illustrate what I mean. This is the file menu I see when there is just one tab (right after drracket starts up): http://www.eecs.northwestern.edu/~robby/tmp/one-tab.png Then, after creating a tab, this is the file menu that I see: http://www.eecs.northwestern.edu/~robby/tmp/two-tabs.png Robby _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
[racket-dev] creating executables
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi list, when creating executables from racket, when I choose (the defaults) standalone based on racket, it will say "creating executable for distribution". I did not choose for distribution, so that is wrong.The created executable fails to run like this: $ ./hello read failed to read all 885878182 bytes from file /home/marijn/racketzooi/./hello Aborted My test program: #lang racket (print "hello") This is on amd64 Linux with a racket from a day old. Marijn -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5flYIACgkQp/VmCx0OL2y3fwCgnJ7uf7DQTaBHlcxXdOk/evoq 8jQAoMPuoC321g0MT+r9axDE6gMUeP5q =j8W+ -END PGP SIGNATURE- _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] drRacket Close/Close tab
At Thu, 1 Sep 2011 09:14:47 -0500, Robby Findler wrote: > On Wed, Aug 31, 2011 at 3:30 AM, Marijn wrote: > >> I like the idea of adding shift, but I've changed things so that > >> instead of the w shortcut going away, the close menu item becomes > >> -shift-w (so the shifting behavior is still there and we > >> are complying with the guidelines in the no-tabs case). > > > > On Gtk nothing has changed for me. > > > > I've managed to get my ubuntu 10.04.1 vm back in shape and rebuild > drracket there and the various keybindings and menu items seem to > shift around as expected. Was that after commit 459d2422e3ad8? I looked into menu-item shortcuts this morning and pushed a Gtk-specific fix for updating the displayed shortcut. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] drRacket Close/Close tab
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/01/11 16:14, Robby Findler wrote: > On Wed, Aug 31, 2011 at 3:30 AM, Marijn wrote: >>> I like the idea of adding shift, but I've changed things so >>> that instead of the w shortcut going away, the close menu item >>> becomes -shift-w (so the shifting behavior is still >>> there and we are complying with the guidelines in the no-tabs >>> case). >> >> On Gtk nothing has changed for me. >> > > I've managed to get my ubuntu 10.04.1 vm back in shape and rebuild > drracket there and the various keybindings and menu items seem to > shift around as expected. I've put a screenshot here to illustrate > what I mean. > > This is the file menu I see when there is just one tab (right > after drracket starts up): > > http://www.eecs.northwestern.edu/~robby/tmp/one-tab.png > > Then, after creating a tab, this is the file menu that I see: > > http://www.eecs.northwestern.edu/~robby/tmp/two-tabs.png > > Robby Interesting, for me only whether Close tab is disabled changes, but not the displayed keybindings. I have both gtk+-2.24.5 and gtk+-3.0.12 installed. Not sure what else could make the difference. Any other Linux users with test data? Marijn -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5fmDoACgkQp/VmCx0OL2ycgACggi9D/AM5mrvtYEJj3Mt+WYTj bxEAn1XqqQTjyXWyAy+1B8DUFwhBpXPU =Kyxd -END PGP SIGNATURE- _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] drRacket Close/Close tab
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/01/11 16:29, Matthew Flatt wrote: > At Thu, 1 Sep 2011 09:14:47 -0500, Robby Findler wrote: >> On Wed, Aug 31, 2011 at 3:30 AM, Marijn >> wrote: I like the idea of adding shift, but I've changed things so that instead of the w shortcut going away, the close menu item becomes -shift-w (so the shifting behavior is still there and we are complying with the guidelines in the no-tabs case). >>> >>> On Gtk nothing has changed for me. >>> >> >> I've managed to get my ubuntu 10.04.1 vm back in shape and >> rebuild drracket there and the various keybindings and menu items >> seem to shift around as expected. > > Was that after commit 459d2422e3ad8? > > I looked into menu-item shortcuts this morning and pushed a > Gtk-specific fix for updating the displayed shortcut. > Alright, that probably explains it. I'll test again tomorrow to make sure. Marijn -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5fmYoACgkQp/VmCx0OL2wuVQCfYSx13oaZCSuBOpfWleJuqn7Z daAAn3+o7qanxUXvT90Wp/3qsQAA9GYt =tRjD -END PGP SIGNATURE- _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] drRacket Close/Close tab
On Thu, Sep 1, 2011 at 9:41 AM, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 09/01/11 16:29, Matthew Flatt wrote: >> At Thu, 1 Sep 2011 09:14:47 -0500, Robby Findler wrote: >>> On Wed, Aug 31, 2011 at 3:30 AM, Marijn >>> wrote: > I like the idea of adding shift, but I've changed things so > that instead of the w shortcut going away, the close menu > item becomes -shift-w (so the shifting behavior is > still there and we are complying with the guidelines in the > no-tabs case). On Gtk nothing has changed for me. >>> >>> I've managed to get my ubuntu 10.04.1 vm back in shape and >>> rebuild drracket there and the various keybindings and menu items >>> seem to shift around as expected. >> >> Was that after commit 459d2422e3ad8? >> >> I looked into menu-item shortcuts this morning and pushed a >> Gtk-specific fix for updating the displayed shortcut. >> > > Alright, that probably explains it. I'll test again tomorrow to make sure. Oh, I missed that commit! Yes, I expect it was afterwards. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] creating executables
I had a similar problem on Linux x86. Matthew just pushed a fix, and now everything works for me. Haven't tried on amd64, though. Vincent At Thu, 01 Sep 2011 16:24:02 +0200, Marijn wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi list, > > when creating executables from racket, when I choose (the defaults) > standalone based on racket, it will say "creating executable for > distribution". I did not choose for distribution, so that is wrong.The > created executable fails to run like this: > > $ ./hello > read failed to read all 885878182 bytes from file > /home/marijn/racketzooi/./hello > Aborted > > > > My test program: > > > > #lang racket > > (print "hello") > > > > This is on amd64 Linux with a racket from a day old. > > Marijn > -BEGIN PGP SIGNATURE- > Version: GnuPG v2.0.18 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk5flYIACgkQp/VmCx0OL2y3fwCgnJ7uf7DQTaBHlcxXdOk/evoq > 8jQAoMPuoC321g0MT+r9axDE6gMUeP5q > =j8W+ > -END PGP SIGNATURE- > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/dev _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] drRacket Close/Close tab
Okay, thanks everyone for the comments. Generally speaking, I dread keybinding-based discussions because it is impossible to make everyone happy (and usually only the unhappy people speak up :). Still, I think you folks are right that changes need to happen. I've looked over various apps and the guidelines and whatnot and (yep, I buy the argument that 'Terminal and Safari don't follow the HIG so why should we?'.) so here's the changes I've just pushed. Mac OS X & Windows : - renamed "Close" to "Close Window" (but kept the keybinding switchero-ness as is) Gtk: - changed the menus so there is only one "Close" menu (no "Close Tab" or "Close Window"); if there are multiple tabs, it closes the tab otherwise it closes the window. To close the window in the multiple tabs case, you have to use the close box (or maybe alt-f4 if the OS-level keybindings map it to closing the window). All platforms: - changed "New Tab" to -t - changed "Run" to -r - changed "Replace" to -shift-f Please let me know if you spot any problems. Thanks, Robby _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
[racket-dev] image snips and pretty-print (#lang htdp/bsl and snips)
How are image snips and pretty-print supposed to interact? I've isolated the bug that's been preventing image snips from printing in something like: ;; #lang htdp/bsl (require 2htdp/image) (circle 20 'solid 'green) ;; >From what I can tell, the print-convert-handler is doing the right thing in leaving the image alone, but then the image snip gets printed via pretty-print, and from what I see in: ;; #lang racket/base (require 2htdp/image racket/pretty) (write (circle 20 'solid 'green)) (newline) (print (circle 20 'solid 'green)) (newline) (pretty-print (circle 20 'solid 'green)) (newline) (pretty-write (circle 20 'solid 'green)) (newline) (pretty-display (circle 20 'solid 'green)) (newline) ;; None of the pretty functions like image snips and print them out textually rather than graphically! As far as I can tell, pretty-print appears to be hardcoded to deal with text, not snips. Is that true? If I comment out the setting of the current-print parameter in htdp/bsl/runtime, ## diff --git a/collects/htdp/bsl/runtime.rkt b/collects/htdp/bsl/runtime.rkt index d612aad..f3c96a1 100644 --- a/collects/htdp/bsl/runtime.rkt +++ b/collects/htdp/bsl/runtime.rkt @@ -56,7 +56,7 @@ (string-length img-str) (oh val display? port]) (thunk))) - (current-print + #;(current-print (lambda (v) (unless (void? v) (define converted (print-convert v)) ## then the program: ;; #lang htdp/bsl (require 2htdp/image) (circle 20 'solid 'green) ;;; behaves properly in DrRacket and prints out fine. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] image snips and pretty-print (#lang htdp/bsl and snips)
Maybe something like this is what you want (but I always get lost in the multitude of handlers so this might not be quite the right place to put this code). diff --git a/collects/htdp/bsl/runtime.rkt b/collects/htdp/bsl/runtime.rkt index d612aad..2865445 100644 --- a/collects/htdp/bsl/runtime.rkt +++ b/collects/htdp/bsl/runtime.rkt @@ -43,18 +43,23 @@ (parameterize ([pretty-print-print-hook (let ([oh (pretty-print-print-hook)]) (λ (val display? port) -(if (and (not (port-writes-special? port)) - (is-image? val)) -(begin (display img-str port) - (string-length img-str)) -(oh val display? port] +(cond + [(is-image? val) + (if (port-writes-special? port) + (write-special val port) + (display img-str port))] + [else + (oh val display? port)])))] [pretty-print-size-hook (let ([oh (pretty-print-size-hook)]) (λ (val display? port) -(if (and (not (port-writes-special? port)) - (is-image? val)) -(string-length img-str) -(oh val display? port]) +(cond + [(is-image? val) + (if (port-writes-special? port) + 1 + (string-length img-str))] + [else + (oh val display? port)])))]) (thunk))) (current-print (lambda (v) Robby On Thu, Sep 1, 2011 at 3:22 PM, Danny Yoo wrote: > How are image snips and pretty-print supposed to interact? > > > I've isolated the bug that's been preventing image snips from printing > in something like: > > ;; > #lang htdp/bsl > (require 2htdp/image) > (circle 20 'solid 'green) > ;; > > > From what I can tell, the print-convert-handler is doing the right > thing in leaving the image alone, but then the image snip gets printed > via pretty-print, and from what I see in: > > ;; > #lang racket/base > (require 2htdp/image > racket/pretty) > > (write (circle 20 'solid 'green)) > (newline) > (print (circle 20 'solid 'green)) > (newline) > (pretty-print (circle 20 'solid 'green)) > (newline) > (pretty-write (circle 20 'solid 'green)) > (newline) > (pretty-display (circle 20 'solid 'green)) > (newline) > ;; > > > None of the pretty functions like image snips and print them out > textually rather than graphically! > > As far as I can tell, pretty-print appears to be hardcoded to deal > with text, not snips. Is that true? > > > > > If I comment out the setting of the current-print parameter in > htdp/bsl/runtime, > > ## > diff --git a/collects/htdp/bsl/runtime.rkt b/collects/htdp/bsl/runtime.rkt > index d612aad..f3c96a1 100644 > --- a/collects/htdp/bsl/runtime.rkt > +++ b/collects/htdp/bsl/runtime.rkt > @@ -56,7 +56,7 @@ > (string-length img-str) > (oh val display? port]) > (thunk))) > - (current-print > + #;(current-print > (lambda (v) > (unless (void? v) > (define converted (print-convert v)) > ## > > > > then the program: > > ;; > #lang htdp/bsl > (require 2htdp/image) > (circle 20 'solid 'green) > ;;; > > behaves properly in DrRacket and prints out fine. > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/dev > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] image snips and pretty-print (#lang htdp/bsl and snips)
On Thu, Sep 1, 2011 at 5:13 PM, Robby Findler wrote: > Maybe something like this is what you want (but I always get lost in > the multitude of handlers so this might not be quite the right place > to put this code). [diff cut] Yes, this works for me as well. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] online check syntax deadlock: can you help?
On Sep 1, 2011, at 5:34 AM, Matthew Flatt wrote: > At Wed, 31 Aug 2011 23:00:25 -0700, John Clements wrote: >> This doesn't work at all for me on the Mac, and highlights a problem that >> I've >> had at other times with racket & GUI frames: none of the keyboard input goes >> to the window. >> >> Specifically, here's the sequence of events: >> >> 1) run racket -W info -l- drracket >> 2) See splash window come up, *underneath* terminal window and not given >> focus. >> 3) See DrRacket frame come up, again without focus. >> 4) Click on DrRacket frame, it gets focus and I see the cursor blinking. >> 5) Type a few characters -- they don't show up in DrRacket. Instead, they go >> to the terminal window. >> Furthermore, there's no DrRacket menu bar, and no DrRacket icon in the >> cmd-tab >> list. >> >> 6) Go back to terminal window, use ctrl-\ to blow it away. >> >> Is that expected? It looks like the OS is preventing >> not-full-fledged-app-things from opening windows and handling input. This is >> OS 10.6,8. > > The code that is supposed to make the process a full-fledged app is > line at line 81 of "collects/mred/private/cocoa/queue.rkt": > > ;; In case we were started in an executable without a bundle, > ;; explicitly register with the dock so the application can receive > ;; keyboard events. > (define-cstruct _ProcessSerialNumber > ([highLongOfPSN _ulong] >[lowLongOfPSN _ulong])) > (define kCurrentProcess 2) > (define kProcessTransformToForegroundApplication 1) > (define-appserv TransformProcessType (_fun _ProcessSerialNumber-pointer >_uint32 >-> _OSStatus)) > (void (TransformProcessType (make-ProcessSerialNumber 0 kCurrentProcess) > kProcessTransformToForegroundApplication)) > > Note that the code ignores the result of `TransformProcessType', which > is a bad idea. If you remove the `void' wrapper, what number result > gets printed on your machine? > Looks like it's -50. Here's the transcript: pcp070159pcs:~/plt clements$ racket -W info -l- drracket -50 Pango: couldn't load font "Apple Chancery Medium Not-Rotated 13", falling back to "Sans Medium Not-Rotated 13", expect ugly output. expanding-place.rkt: 01 starting thread expanding-place.rkt: 02 setting basic parameters expanding-place.rkt: 03 setting module language parameters expanding-place.rkt: 04 setting directories expanding-place.rkt: 05 installing security guard expanding-place.rkt: 06 setting uncaught-exception-handler expanding-place.rkt: 07 starting read-syntax expanding-place.rkt: 08 read expanding-place.rkt: 09 starting expansion expanding-place.rkt: 10 expanded expanding-place.rkt: 11 handlers finished expanding-place.rkt: 12 finished John smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev