chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] matchable egg usage question


From: Alex Shinn
Subject: Re: [Chicken-users] matchable egg usage question
Date: Sun, 30 Jan 2011 12:28:00 +0900

On Sun, Jan 30, 2011 at 12:09 PM, Alan Post <address@hidden> wrote:
>
> Alex, will you explain what I'd doing wrong here using
> tree searching patterns?
>
> (pretty-print (map
>  (match-lambda
>    (('foo *** '(bar 1)) #t)
>    (_ #f))
>  '((foo (bar 1))
>    (foo (a (bar 1)))
>    (foo (a (b (bar 1))))
>    (foo (a (b (c (bar 1))))))))
>
> Only the first form |(foo (bar 1))| is returning #t here.
> The remaining forms return #f.  I would expect all of them
> to return true, based on my naive understanding of the ***
> operator.

'foo has to match every step of the path.  It sounds
like you want

  ('foo (_ *** '(bar 1)))

-- 
Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]