Hi!
Stefan Israelsson Tampe writes:
> On Thursday, September 02, 2010 05:59:59 pm Ludovic Courtès wrote:
>> Hmm. So IIUC, the sub-pattern ‘(<> .r1)’ matches anything that
>> is a match according to custom matcher ‘’, and binds the sub-match
>> ‘r1’ of ‘’ to ‘.r1’, right?
>
> Hmm maybe need to
On Thursday, September 02, 2010 05:59:59 pm Ludovic Courtès wrote:
> Hmm. So IIUC, the sub-pattern ‘(<> .r1)’ matches anything that
> is a match according to custom matcher ‘’, and binds the sub-match
> ‘r1’ of ‘’ to ‘.r1’, right?
Hmm maybe need to clarify
.r1 is just a variable name is a funct
cons [b b] [])
> >
> > e.g. macthes a sequence of a:s and macthes a sequence of b:s. a
> > failure in this protocol is represented by the car of the retruning cons
> > beeing false.
>
> OK.
>
> > Note, we could use a plain multiple return values protocol but t
his protocol is represented by the car of the retruning cons
> beeing false.
OK.
> Note, we could use a plain multiple return values protocol but that is for
> later discussion.
>
> so using match-abs we would like the following
>
> (match [a a b b] (( ) (append .r .r)))
&g
Hi!
Stefan Israelsson Tampe writes:
[...]
> But I think that we
> should write a proper match-test.scm for unit testing.
Let your dreams come true: it’s already there! :-)
Thanks,
Ludo’.
On Tuesday, August 31, 2010 04:42:36 pm Ludovic Courtès wrote:
> BTW I added a small section in the manual describing (ice-9 match):
>
>
> http://git.savannah.gnu.org/cgit/guile.git/commit/?id=358663caf54994e2b7d0
> c2eb1dd8ce8794116971
>
> Comments & improvements welcome!
>
> Thanks,
> Ludo’.
thes a sequence of b:s. a
failure in this protocol is represented by the car of the retruning cons
beeing false.
Note, we could use a plain multiple return values protocol but that is for
later discussion.
so using match-abs we would like the following
(match [a a b b] (( ) (append .r .r)))
to res
BTW I added a small section in the manual describing (ice-9 match):
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=358663caf54994e2b7d0c2eb1dd8ce8794116971
Comments & improvements welcome!
Thanks,
Ludo’.
Hi Stefan!
Stefan Israelsson Tampe writes:
> I've hacked on extension on ice-9/match for making modular matching possible
> with a reasonable interface.
That sounds like a worthy goal to me. Pattern matching in Scheme
appears to be limited in this respect compared to other functional
languages
dules (ice-9 match-abs))
;;Example, notice (( A B)) means first result of is stored in A and
the second is in B
(define ( X)
(match abstractions (( A B))
X
(['-. L] (cons (- B A) L))
(['+. L] (cons (+ A B) L))
(['*. L
10 matches
Mail list logo