Re: [racket-users] Re: inflate/deflate

2017-01-12 Thread Tony Garnock-Jones
Hi Lehi, On 01/12/2017 06:17 PM, Lehi Toskin wrote: > Now that I think about it, it's probably naive of > me to simple add those two bytes and expect everything to actually be > working as expected [...] I'm assuming the Z_BUF_ERROR is being > reported because it's not as flexible and the

Re: [racket-users] Re: inflate/deflate

2017-01-12 Thread Lehi Toskin
Thanks to Tonyg's links, I figured out that the part I was missing was the ADLER-32 check of the uncompressed data added to the end of the byte string. That makes the total byte string composition look like this: (bytes #x78 #x9c) compressed-data-from-deflate (number->bytes (adler32

Re: [racket-users] Copying a namespace?

2017-01-12 Thread Alex Knauth
> On Jan 12, 2017, at 7:43 AM, Matthew Flatt wrote: > > My thought is similar to Robby's: Does it work to add a fresh scope to > every identifier that you bind in the debug REPL and also add that > scope to everything evaluated in the REPL? > > It seems like

Re: [racket-users] Copying a namespace?

2017-01-12 Thread Alex Knauth
> On Jan 12, 2017, at 5:33 PM, Alex Knauth wrote: > > >> On Jan 12, 2017, at 7:43 AM, Matthew Flatt wrote: >> >> My thought is similar to Robby's: Does it work to add a fresh scope to >> every identifier that you bind in the debug REPL and also add

[racket-users] Re: inflate/deflate

2017-01-12 Thread Lehi Toskin
On Thursday, January 12, 2017 at 10:59:13 AM UTC-8, Ethan Estrada wrote: > Then, is this a bug or something that should be an optional argument on the > function like `#:ignore-initial-bytes #t`? I am not deeply familiar with the > DEFLATE file format, but this seems like bug since it doesn't

[racket-users] Macro question

2017-01-12 Thread Erich Rast
Hi all, I'm programming in Racket for many years and still haven't used macros or delved into how they work. Kind of embarrassing... anyway, it should be clear what I want to achieve in the code below. I like to wrap a module around framework/preferences, abstracting from the preference

[racket-users] newlines in scribble interaction output

2017-01-12 Thread Jos Koot
Hi, Consider: #lang scribble/manual @(require scribble/core scribble/eval) @interaction[ (printf "a~n~nb")] Shows one newline only. It produces: | > (printf "a~n~nb") | a | b It is not a big problem. I can write: @interaction[ (printf "a~n ~nb")] which produces: | > (printf

[racket-users] String to list?

2017-01-12 Thread Andreas Olsson
If i got " '(2 2 2) " as input via read-line and want to convert it to '(2 2 2), how do I do 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

Re: [racket-users] String to list?

2017-01-12 Thread Deren Dohoda
In general you can (read (open-input-string " ...")). In this case (second (read (open-input-string "'(2 2 2)"))) Since read will quote the input and if you don't take the second element you'll get ''(2 2 2) Deren On Fri, Jan 13, 2017 at 2:18 AM, Andreas Olsson wrote:

Re: [racket-users] Macro question

2017-01-12 Thread Matthias Felleisen
> On Jan 12, 2017, at 6:21 AM, Erich Rast wrote: > > #lang racket > (require framework/preferences) > (provide init-preferences const:app-name const:app-version > pref:db-path) > > (define const:app-name "Virtual Assistant") > (define const:app-version 1.0) > > (define

Re: [racket-users] Macro question

2017-01-12 Thread Erich Rast
Nevermind, I got it working (or at least it seems to work): (define-syntax-rule (defpref ident default test?) (begin (define ident (case-lambda [() (pref 'ident)] [(value) (pref 'ident value)])) (pref 'ident default test?))) Best, Erich -- You received this

Re: [racket-users] Macro question

2017-01-12 Thread Erich Rast
Thanks for your your help. Unfortunately, I haven't managed to get my head around the phases and the question of when symbols are quoted or evaluated. I tried Matthew Buttericks change but it yields an error: "format-id: undefined; cannot reference an identifier before its definition phase: 1"

Re: [racket-users] Macro question

2017-01-12 Thread Jens Axel Søgaard
Let's take a look at this error: "format-id: undefined; cannot reference an identifier before its definition phase: 1" Since format-id is undefined, we need to require the corresponding module. The docs say the identifier is from racket/syntax. Now (require racket/syntax)