[racket-users] Type Racket command-line #:ps causing type error

2017-05-16 Thread kay
Hi I feel this might be a bug, can anyone confirm or suggest a fix? Here's a minimal usage of `command-line` form: ``` #lang typed/racket (define *message* : (Parameterof (Listof String)) (make-parameter '())) (define *verbose* : (Parameterof Boolean) (make-parameter #f)) (define (parse-cmdline

[racket-users] surprising [to me and students] printer behavior with #:transparent

2017-05-16 Thread Dan Grossman
Hi all, In my course here on campus, I have students use #lang racket and we put #:transparent on our struct definitions for easier REPL interactions. A student was confused by the different printer-behavior between a and b in the attached screenshot, and I can't think of a reason for the differe

Re: [racket-users] surprising [to me and students] printer behavior with #:transparent

2017-05-16 Thread Philip McGrath
The printer tries to produce an expression that you could copy, paste, and evaluate. Transparent structs aren't quotable but do support constructor-style printing, so the printer uses constructor-style printing for values that contain transparent structs. (Apparently you can configure this in DrRac

[racket-users] sharing a value between a DrRacket tool and a user program

2017-05-16 Thread 'John Clements' via Racket Users
Austin Sparks (cc:ed) and I are struggling with what I believe should be a pretty simple problem; how can we share a value between a DrRacket tool and a user’s program? Specifically, the value in question here is a channel (probably an asynchronous channel) on which the user’s thread can place

Re: [racket-users] surprising [to me and students] printer behavior with #:transparent

2017-05-16 Thread Dan Grossman
Ah, got it, makes perfect sense through that lens -- thanks! On Tue, May 16, 2017 at 9:37 AM, Philip McGrath wrote: > The printer tries to produce an expression that you could copy, paste, and > evaluate. Transparent structs aren't quotable but do support > constructor-style printing, so the pri

Re: [racket-users] sharing a value between a DrRacket tool and a user program

2017-05-16 Thread Vincent St-Amour
John, Austin, You can use loggers for this. The `data` argument to `log-message` allows payloads to be carried along with log messages. Just have the user program log messages with a particular topic, and have the tool listen on that topic. That's how the optimization coach (which is a DrRacket t

Re: [racket-users] sharing a value between a DrRacket tool and a user program

2017-05-16 Thread Robby Findler
If you have control of the language<%> class, then you can do that via the on-execute method. If you want to do that for all languages (which is probably not a good idea, but you could use this approach and limit it to a known set of languages), you could override the on-execute method of the rep<%

[racket-users] How to discard an unknown number of (values) return?

2017-05-16 Thread David Storrs
I have a macro that wraps a function call in some debugging information. I would like to discard the results of the function call so that they don't end up printed. This usually works: (void (func)) ...but it fails if func uses (values) to return multiple values, since void is variadic but no

Re: [racket-users] How to discard an unknown number of (values) return?

2017-05-16 Thread Ben Greenman
Try `(call-with-values func void)` http://docs.racket-lang.org/reference/values.html#%28def._%28%28quote._~23~25kernel%29._call-with-values%29%29 On Tue, May 16, 2017 at 5:56 PM, David Storrs wrote: > I have a macro that wraps a function call in some debugging information. > I would like to dis

Re: [racket-users] How to discard an unknown number of (values) return?

2017-05-16 Thread David Storrs
Well, that was simpler than expected. (As is usually the case with Racket.) Thanks, Ben. On Tue, May 16, 2017 at 5:59 PM, Ben Greenman wrote: > Try `(call-with-values func void)` > > http://docs.racket-lang.org/reference/values.html#%28def._ > %28%28quote._~23~25kernel%29._call-with-values%29%

Re: [racket-users] sharing a value between a DrRacket tool and a user program

2017-05-16 Thread 'John Clements' via Racket Users
> On May 16, 2017, at 11:23 AM, Vincent St-Amour > wrote: > > John, Austin, > > You can use loggers for this. The `data` argument to `log-message` > allows payloads to be carried along with log messages. Just have the > user program log messages with a particular topic, and have the tool > lis

Re: [racket-users] sharing a value between a DrRacket tool and a user program

2017-05-16 Thread 'John Clements' via Racket Users
> On May 16, 2017, at 11:26 AM, Robby Findler > wrote: > > If you have control of the language<%> class, then you can do that via > the on-execute method. If you want to do that for all languages (which > is probably not a good idea, but you could use this approach and limit > it to a known set

Re: [racket-users] sharing a value between a DrRacket tool and a user program

2017-05-16 Thread Robby Findler
On Tue, May 16, 2017 at 7:07 PM, 'John Clements' via Racket Users wrote: > >> On May 16, 2017, at 11:26 AM, Robby Findler >> wrote: >> >> If you have control of the language<%> class, then you can do that via >> the on-execute method. If you want to do that for all languages (which >> is probabl

[racket-users] Re: Type Racket command-line #:ps causing type error

2017-05-16 Thread lu
On Tuesday, May 16, 2017 at 12:47:37 AM UTC-7, kay wrote: > Hi I feel this might be a bug, can anyone confirm or suggest a fix? > > Here's a minimal usage of `command-line` form: > > ``` > #lang typed/racket > > (define *message* : (Parameterof (Listof String)) (make-parameter '())) > (define *v