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:
> If i got " '(2 2 2) " a
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 racket-users+un
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
uncompressed
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 structur
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 int
> 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 that
>> scope to everything evaluated in the
> 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 `splicing-let...` is more complex th
On Wednesday, January 11, 2017 at 11:01:04 PM UTC-7, Lehi Toskin wrote:
> Interesting... If I prepend `(bytes #x78 #x9c)` to the compressed data
> created by deflate, zlib-flate will uncompress it. Same thing happens in
> reverse where I skip the first two bytes of the zlib-flate'd data and proce
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) w
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 mess
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"
> 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 default-datapath
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 `splicing-let...` is more complex than you need, since
all the complexity in `splicing-let...` is makin
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 "a~n~nb"
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
implementa
15 matches
Mail list logo