Damn, you're right:
martin@janiczek ~ $ cat test.rkt
(parameterize ([read-accept-bar-quote #f])
(let* ([input "(|| a b)"]
[result (read (open-input-string input))])
(println (first result))
(println (symbol? (first result))))))
martin@janiczek ~ $ racket test.rkt
'(|| a b)
martin@janiczek ~ $
I don't know what I did wrong before. Thank you!
On Friday, August 11, 2017 at 3:26:20 PM UTC+2, Matthew Flatt wrote:
> Setting `read-accept-bar-quote` to #f should do what you want. Can you
> say more about how you tried to use it --- maybe providing a program
> that doesn't behave the way you expect?
> At Fri, 11 Aug 2017 00:46:17 -0700 (PDT), Martin Janiczek wrote:
> > Hello everybody,
> > is there a way to tell the `(read)` function not to interpret `|` as an
> > "copy
> > this verbatim" delimiter?
> > What I want to do is:
> > (read "(|| a b)") ;=> '(|| a b)
> > (read "(<| a b)") ;=> '(<| a b)
> > etc. - allow `|` as a symbol.
> > I know about readtables - dabbled with them before and they seem like the
> > right tool for the job. But in this case, my last attempt was:
> > (make-readtable (current-readtable)
> > #\|
> > 'terminating-macro
> > read-as-symbol)
> > and I couldn't get the `read-as-symbol` function right. Also experimented
> > with
> > `read-accept-bar-quote` parameter but no dice.
> > Any help/pointers?
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
For more options, visit https://groups.google.com/d/optout.