[Top][All Lists]
[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: |
Thu, 27 Jan 2011 08:15:36 -0700 |
I'm only going to get more demanding out of what I'd like match to
do, I would like the latest version.
-Alan
On Thu, Jan 27, 2011 at 10:17:19PM +0900, Alex Shinn wrote:
> Fixed upstream, including http://synthcode.com/scheme/match-cond-expand.scm,
> which is basically suitable for Chicken modulo the module syntax.
>
> Do we want the latest version for Chicken (with tree patterns and ..1),
> or should I just patch this one bug?
>
> --
> Alex
>
>
> On Tue, Jan 25, 2011 at 8:32 AM, Alan Post <address@hidden> wrote:
> > 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
> >
>
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/chicken-users
--
.i ko djuno fi le do sevzi