On Tuesday, August 18, 2015 at 1:24:38 AM UTC-4, Alex Knauth wrote:
> On Aug 18, 2015, at 1:18 AM, Brian Adkins <lojicdot...@gmail.com> wrote:
> 
> > On Tuesday, August 18, 2015 at 1:13:16 AM UTC-4, Alex Knauth wrote:
> >> Is == what you're looking for?
> >> Or do you want a version of == that uses string=? ?
> > 
> > I'm not sure what you're suggesting. I basically want a way to inject the 
> > value of x into the pattern vs. using a literal such as "abc" since I need 
> > to do this programmatically. The #:when clause and/or the ? function are 
> > reasonable work arounds - I'm just hoping there's a more concise way to get 
> > the value of x into the pattern.
> 
> I mean like this:
> #lang racket
> (define x "abc")
> (match '(1 "abc")
>   [(list 1 (== x)) #t]
>   [_ #f])

Ah! Yes, that works. I did scroll down quite a bit in the match documentation, 
but apparently stopped before secion 9.3 I think that's exactly what I was 
looking for - thanks!

-- 
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