Re: match-abs

2010-09-02 Thread Ludovic Courtès
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

Re: match-abs

2010-09-02 Thread Stefan Israelsson Tampe
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

Re: match-abs

2010-09-02 Thread Stefan Israelsson Tampe
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

Re: match-abs

2010-09-02 Thread Ludovic Courtès
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

Re: match-abs

2010-09-01 Thread Ludovic Courtès
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’.

Re: match-abs

2010-09-01 Thread Stefan Israelsson Tampe
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’.

Re: match-abs

2010-09-01 Thread Stefan Israelsson Tampe
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

Re: match-abs

2010-08-31 Thread Ludovic Courtès
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’.

Re: match-abs

2010-08-30 Thread Ludovic Courtès
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

match-abs

2010-08-29 Thread Stefan Israelsson Tampe
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