From: stefan <stefan.tampe@spray.se>
To: guile-devel@gnu.org
Subject: Re: fmatch
Date: Sun, 20 Jun 2010 21:58:59 +0200 [thread overview]
Message-ID: <201006202158.59070.stefan.tampe@spray.se> (raw)
In-Reply-To: <87hbl2iogc.fsf@gnu.org>
On Wednesday 16 June 2010 11:31:14 pm Ludovic Courtès wrote:
> Hi Stefan!
>
> Sorry for the late late reply.
>
> stefan <stefan.tampe@spray.se> writes:
> > Anyway git diff --cached gives the attached patch file.
> >
> > Also I made the code less hacky by using define-syntax in stead
> > of a defmacro and macroexpand for the defin-syntax sugar (oh hacker).
> > It was a litle more work then I expected.
>
> OK. I just applied the patch and looked at ice-9/match.scm.
>
> To start with, I committed the unmodified pattern matcher by Shinn, a
> simple (ice-9 match) that just includes it, and a small set of tests.
>
> The next step will be to integrate your work in match.upstream.scm (sic)
> and discuss it with Shinn.
>
> Thanks,
> Ludo'.
Cool!
I think that the match-define logic is something that is missing in the
Shinn version although I don't know how much this construct is used.
For the $ destruction I would be very careful, as you know from the irc
discussion. So for all to be able to participate here is a short
description of the problem with $.
Basically $ is using the order of the records like ($ person? Rec1 Rec2 , ...
Recn)
and is nice to do quick hacks and get dense informative matchers. On the
other hand if the record specification changes, like the order of the
records or meanings etc havoc can enter. So destructuring on order would
probably, in the end, yield a buggy code base. And I suspect that this issue
makes the $ construct less liked and probably will not be accepted upstreams.
On the other hand we have the record-case construct that is somewhat dense in
information but is not hygienic. That would leave us with constructs like
(and (= person-height pat1)
(= person-weight pat2)
...)
We can streamline it a little but the end win is marginal compared to the
size of usual accessor names.
I would have liked something like
($ person (height pat1) (weight pat2))
But again this is not hygienic!
What do you think?
Regards
Stefan
next prev parent reply other threads:[~2010-06-20 19:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 20:39 fmatch stefan
2010-05-07 11:59 ` fmatch Ludovic Courtès
2010-05-07 14:24 ` fmatch stefan
2010-05-07 20:23 ` fmatch Ludovic Courtès
2010-05-07 20:53 ` fmatch stefan
2010-05-09 20:57 ` fmatch Ludovic Courtès
2010-05-09 20:52 ` fmatch stefan
2010-05-10 8:26 ` fmatch Ludovic Courtès
2010-05-11 14:26 ` fmatch Stefan
2010-05-17 20:08 ` fmatch stefan
2010-05-22 21:03 ` fmatch Ludovic Courtès
2010-05-22 21:31 ` fmatch stefan
2010-05-23 16:06 ` fmatch Ludovic Courtès
2010-05-23 15:47 ` fmatch stefan
2010-05-24 20:08 ` fmatch Ludovic Courtès
2010-05-24 21:05 ` fmatch stefan
2010-05-25 17:41 ` fmatch Ludovic Courtès
2010-05-25 21:10 ` fmatch stefan
2010-06-16 21:31 ` fmatch Ludovic Courtès
2010-06-20 19:58 ` stefan [this message]
2010-06-20 21:56 ` fmatch Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201006202158.59070.stefan.tampe@spray.se \
--to=stefan.tampe@spray.se \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).