On Fri, Oct 28, 2016 at 3:18 PM, David Storrs <david.sto...@gmail.com> wrote:
> tl;dr :  Why is the following an error?
>
> #lang at-exp racket
> (define a "this")
> @pregexp{^@a}  ;; Should produce #px"^this" but errors out
> @pregexp{@(~a "^" a)}  ;; This works but is clumsy

I see that the problem was pointed to you several times, but I didn't
see suggestions for a convenient replacement.  I often have something
like this:

    #lang at-exp racket
    (define px (compose pregexp string-append))   ; <--- like this
    (define a "this")
    @px{^@a}  ; works fine, and looks like a variant of #px"..."


[[ You can also do this for a one-time-use:

    @(compose pregexp string-append){^@a}

but that's almost as bad as one of

    @pregexp{@string-append{^@a}}
    @pregexp[@string-append{^@a}]
    (pregexp @string-append{^@a})

]]

-- 
                   ((x=>x(x))(x=>x(x)))                  Eli Barzilay:
                   http://barzilay.org/                  Maze is Life!

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to