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 14:23:18 +0900

On Sun, Jan 30, 2011 at 1:40 PM, Alex Shinn <address@hidden> wrote:
>
> Because it searches for patterns where the head of the tree
> at each step along the path matches _, and the leaf matches
> '(bar 1).  The head is not searched as a potential leaf.

Sorry, whether the head is checked as a leaf or not
is irrelevant in this case - the node must either be a
list with a matching head pattern, or the leaf pattern.
In this case it doesn't match the leaf, so the entire
head (a (b (bar 1))) is matched as _, and then the
tail of () recursively searched (and fails).  It won't
match one pattern and then recursively search
within the matched value for other patterns.

-- 
Alex



reply via email to

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