[racket-users] [ANN] A Scribble library for typesetting grammar differences

2020-07-17 Thread William J. Bowman
I just released a library for typesetting `racketgrammar`s with annotations to highlight what has been added or removed compared to another grammar. You can install it via `raco pkg install scribble-bettergrammar` Documentation is available here:

Re: [racket-users] reading s-expressions from a file

2020-07-17 Thread gfb
Shouldn't the for be (for ([expr (in-producer read eof)] ⋯). One could also specify the input port there, as shown in reference for in-producer , possibly inside

Re: [racket-users] reading s-expressions from a file

2020-07-17 Thread George Neuner
On 7/17/2020 8:19 PM, Hendrik Boom wrote: Yes, I know the functino for reading s-expressions seems to be (read [in]). I want a loop that reads S-expressions and does something to each one, until there are no more to be found in a file. Now of course that's absurdly easy to do with a

Re: [racket-users] reading s-expressions from a file

2020-07-17 Thread Sorawee Porncharoenwase
(with-input-from-file "abc" (thunk (sequence->list (in-port Note that you need to “read” in the dynamic extent of with-input-from-file. Outside it, the port is closed. On Fri, Jul 17, 2020 at 5:19 PM Hendrik Boom wrote: > Yes, I know the functino for reading s-expressions seems to be

[racket-users] reading s-expressions from a file

2020-07-17 Thread Hendrik Boom
Yes, I know the functino for reading s-expressions seems to be (read [in]). I want a loop that reads S-expressions and does something to each one, until there are no more to be found in a file. Now of course that's absurdly easy to do with a tail-recursice loop. But I's like it to look like a

Re: [racket-users] Best data structure for ordered data set with insertion and reordering?

2020-07-17 Thread David Storrs
Thanks George. Much appreciated. On Thu, Jul 16, 2020 at 11:21 PM George Neuner wrote: > > Hi David, > > On 7/16/2020 11:44 AM, David Storrs wrote: > > On Thu, Jul 16, 2020 at 10:09 AM George Neuner > wrote: > >> >> The problem seems under-specified. Can you say more about the real >>

Re: [racket-users] file->bytes with large files

2020-07-17 Thread Greg Rosenblatt
Thanks. Depending on how the increment compares to the file size, file->bytes might be up to 1.5x faster (on my machine at least) than the workaround. But the workaround is still fast enough. (define (file->bytes2 file-name) (define size (file-size file-name)) (define bs (make-bytes