Oh, neat. Thank you, Sorawee.
On Thu, Jun 27, 2019 at 7:26 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:
> If you want only one match, it seems what you really want is ~seq-like
> form from syntax/parse. E.g.,
>
> #lang racket
>
> (require syntax/parse)
>
> (define ->value
If you want only one match, it seems what you really want is ~seq-like form
from syntax/parse. E.g.,
#lang racket
(require syntax/parse)
(define ->value syntax->datum)
(define (apply-lift op args)
(datum->syntax #f (apply op (->value args
(syntax-parse (vector 1 2 3 4)
[#(a {~and
On Thu, Jun 27, 2019 at 5:13 PM Eric Griffis wrote:
> On Thu, Jun 27, 2019 at 11:56 AM David Storrs
> wrote:
> >
> > Suppose instead I wanted to have a pattern like so (this does not work):
> >
> > (match (vector 1 2 3 4)
> > [(vector a (app + b ..2 x) c) (list a b c x)]
> > ; => '(1 (2 3) 4
On Thu, Jun 27, 2019 at 11:56 AM David Storrs
wrote:
>
> Suppose instead I wanted to have a pattern like so (this does not work):
>
> (match (vector 1 2 3 4)
> [(vector a (app + b ..2 x) c) (list a b c x)]
> ; => '(1 (2 3) 4 5)) ; NB: does not work
We have a few problems here.
The pattern
This works:
(match (vector 1 2 3 4)
[(vector a b (app add1 c) d)
(list a b c d)])
; => '(1 2 4 4)
Suppose instead I wanted to have a pattern like so (this does not work):
(match (vector 1 2 3 4)
[(vector a (app + b ..2 x) c) (list a b c x)]
; => '(1 (2 3) 4 5)) ; NB: does not work
Is
5 matches
Mail list logo