There's a string-append match expander for that here, although it's pretty slow 
right now.
http://docs.racket-lang.org/match-string/index.html 
<http://docs.racket-lang.org/match-string/index.html>

Alex Knauth

> On Mar 17, 2016, at 7:17 PM, Matthew Butterick <m...@mbtype.com 
> <mailto:m...@mbtype.com>> wrote:
> 
> Racket's `match` is not far from this. In fact maybe I shouldn't be thinking 
> in terms of hacking regexps, but rather making a new match expander. For 
> instance, you can destructure a list like so:
> 
> (match '("foo" "-42.3" "bar")
>  [(list a (? string->number b) c) 'yay]
>  [else 'boo])
> 
> So it would extend logically to this pseudocode:
> 
> (match "foo-42.3bar"
>  [(string-append a (? string->number b) c) 'yay]
>  [else 'boo])

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