Re: [racket-users] Catching syntax errors

2017-06-30 Thread Philip McGrath
If testing with parenthetical syntax is sufficient, you might want something like this: #lang racket (with-handlers ([exn:fail:syntax? values]) (eval `(module bad racket (define foo (define bar 1))) (make-base-namespace))) which returns: (exn:fail:syntax "define: not allowed in an

[racket-users] Catching syntax errors

2017-06-30 Thread Sam Waxman
Hello, I'm trying to test whether or not certain programs result in syntax errors. For example the program #lang racket a will result in an unbound identifier error, even before runtime (you'll see the little error message at the bottom because it errored in phase 1). I know how to catch

[racket-users] Re: Plot: line with histogram

2017-06-30 Thread Deren Dohoda
I asked too soon. It appears that the markers for histograms are not ticks. So you can simply parameterize plot-x-ticks to no-ticks. This does not affect the histogram markers. Sorry for the noise. Deren On Fri, Jun 30, 2017 at 2:28 PM, Deren Dohoda wrote: > Hi

[racket-users] Plot: line with histogram

2017-06-30 Thread Deren Dohoda
Hi Racketeers, I'm trying to put a horizontal line on a histogram plot so one can see whether the height passes some threshold. It's no problem for plot, but the ticks generated are some combination of how (function ...) wants to have ticks and how (discrete-histogram ...) wants to have ticks.

Re: [racket-users] can `impersonate-hash` really filter out hash keys?

2017-06-30 Thread Matthew Butterick
That's a good suggestion. Yes, that will be smoother. > On Jun 30, 2017, at 10:31 AM, Philip McGrath wrote: > > If it doesn't absolutely have to be a hash, you can definitely make dict-ref > and dict-iterate-key etc. work differently. -- You received this message

Re: [racket-users] can `impersonate-hash` really filter out hash keys?

2017-06-30 Thread Philip McGrath
If it doesn't absolutely have to be a hash, you can definitely make dict-ref and dict-iterate-key etc. work differently. -Philip On Fri, Jun 30, 2017 at 12:15 PM, Matthew Butterick wrote: > > > On Jun 30, 2017, at 10:07 AM, Robby Findler > wrote:

Re: [racket-users] can `impersonate-hash` really filter out hash keys?

2017-06-30 Thread Matthew Butterick
> On Jun 30, 2017, at 10:07 AM, Robby Findler > wrote: > > Maybe you could make the impersonator (it would be a chaperone, really > in what I'm suggesting) signal an error if it gets one of the private > keys and then hand out only the hashes with the impersonator

Re: [racket-users] can `impersonate-hash` really filter out hash keys?

2017-06-30 Thread Robby Findler
Maybe you could make the impersonator (it would be a chaperone, really in what I'm suggesting) signal an error if it gets one of the private keys and then hand out only the hashes with the impersonator around it, keeping the "raw" one around for code that is allowed to access the private keys?

Re: [racket-users] how to get full tracebacks in DrRacket?

2017-06-30 Thread Matthew Butterick
Whoa! Nice feature, perhaps a little too well camouflaged ;) > On Jun 30, 2017, at 8:41 AM, Robby Findler > wrote: > > You have to click on the icon (to the right of "in-list" in the example) to > see it in the current implementation. -- You received this

[racket-users] can `impersonate-hash` really filter out hash keys?

2017-06-30 Thread Matthew Butterick
I'd like to make a hash impersonator that has "private" keys that can be reached by `hash-ref`, but which are not reported by `hash-keys` and other operations that iterate over all keys. The docs for `impersonate-hash` [1] say that you can "use `key-proc` to filter keys extracted from the

Re: [racket-users] Typed Racket Type Annotations - Best Practices?

2017-06-30 Thread Sam Tobin-Hochstadt
On Fri, Jun 30, 2017 at 10:03 AM, Zelphir Kaltstahl wrote: > > Ok but what is the best practice? Using: > > ~~~ > (ann a Type) > ~~~ > > ~~~ > (: a Type) > ~~~ > > ~~~ > (a : Type) > ~~~ > > and when? For example in a let form, I could imagine that it might be best >

Re: [racket-users] Hint on opening enclosing directory of current file from DrRacket

2017-06-30 Thread James
On Jun 28, 2017, at 5:42 PM, Glenn Hoetker wrote: > Caveats: 1. Since CWD is set to the most recently run file, you have to have > run the file whose enclosing directory you wish to open. The default appears > to the home directory. 2. I know this works on MacOS. I can't see why it > wouldn't

Re: [racket-users] Typed Racket Type Annotations - Best Practices?

2017-06-30 Thread Zelphir Kaltstahl
On Friday, June 30, 2017 at 6:59:27 AM UTC+2, johnbclements wrote: > > On Jun 29, 2017, at 17:33, Zelphir Kaltstahl > > wrote: > > > > A while ago I started looking at Typed Racket and today I took a look again. > > > > The documentation says: > > > >> Typed Racket

Re: [racket-users] Missing request-post-data/raw (from web-server/http)

2017-06-30 Thread Philip McGrath
Thanks, Jay. It is definitely POST, and there is a Content-Length header, so it seems like the problem is indeed #3. I was expecting the raw data to be there even if it had been parsed — I believe the POST data of # "corpus=austen=corpus.CorpusMetadata" was also parsed into bindings (though not

Re: [racket-users] Missing request-post-data/raw (from web-server/http)

2017-06-30 Thread Jay McCarthy
Hi Philip, I don't necessarily know the answer and it's possible that it is an error. I'll explain what it is doing and maybe that will help us move forward. 1) The request-bindings/raw is just an abstraction over request-post-data/raw (and the URI) 2) The request-post-data/raw is always #f for

[racket-users] TCP no delay (De-activating Nagle's algorithm).

2017-06-30 Thread Maël N .
Hello, When implementing latency-sensitive TCP application, it's really common to use the option TCP_NODELAY do de-activate Nagle's algorithm (https://en.wikipedia.org/wiki/Nagle%27s_algorithm). I found no way in racket/tcp (https://docs.racket-lang.org/reference/tcp.html) or racket & openssl