chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Re: matchable egg ticket #487


From: Alan Post
Subject: Re: [Chicken-users] Re: matchable egg ticket #487
Date: Mon, 24 Jan 2011 16:32:38 -0700

On Tue, Jan 25, 2011 at 07:51:12AM +0900, Alex Shinn wrote:
> On Sun, Jan 23, 2011 at 3:01 PM, Alan Post <address@hidden> wrote:
> >
> > I've just come across a bug in the matchable egg which I've
> > documented in ticket #487:
> >
> >  http://bugs.call-cc.org/ticket/487
> >
> > A call is made to |length| even when the input isn't a list if a
> > production contains |...|.
> 
> Thanks, those tail-patterns are a relatively recent extension
> and this is indeed a bug.  I'll fix it ASAP.
> 

I tried using |...| as something of a last resort trying to match a
tail pattern, thinking "I wonder if the ... in the documentation is
literal, rather than elision.  I couldn't figure out any other way
to match a tail pattern.  Given that they are new, I see now I may
have used something that wasn't documented, which clears up a
confusion of mine.

I wrote such a lengthy test case just to prove to myself that ...
was working like I expected it to.

These tail-pattern matches are a time-saver for me.  In one
particular case I have a complex set of boolean variables that I use
to generate code, and I use match later on in the routine in order
to determine what happened, rather than reusing the boolean
variables to see if I made a modification.

Basically, I have:

 if A do x, y
 if B do y, z
 if C do x, z

and I mant to make sure I do x, y, or z only once, even if there are
multiple variables set that require it.

Thank you Alex!

-Alan
-- 
.i ko djuno fi le do sevzi



reply via email to

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