From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Shinn Newsgroups: gmane.lisp.guile.devel Subject: =?windows-1252?q?Re=3A_=91match=92_and_=93k_or_more=94_patterns?= Date: Mon, 6 Sep 2010 10:46:58 +0900 Message-ID: References: <877hj0xmcp.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1283774735 31617 80.91.229.12 (6 Sep 2010 12:05:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Sep 2010 12:05:35 +0000 (UTC) To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Sep 06 14:05:34 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OsaS4-000076-FN for guile-devel@m.gmane.org; Mon, 06 Sep 2010 14:05:32 +0200 Original-Received: from localhost ([127.0.0.1]:54663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsaS3-0006mN-ML for guile-devel@m.gmane.org; Mon, 06 Sep 2010 08:05:31 -0400 Original-Received: from [140.186.70.92] (port=47715 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsaNl-0004PL-9I for guile-devel@gnu.org; Mon, 06 Sep 2010 08:01:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OsaFT-0004Uh-Po for guile-devel@gnu.org; Mon, 06 Sep 2010 07:52:32 -0400 Original-Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:54844) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsaFT-0004Ub-J5 for guile-devel@gnu.org; Mon, 06 Sep 2010 07:52:31 -0400 X-IronPort-AV: E=Sophos;i="4.56,325,1280700000"; d="scan'208";a="66990907" Original-Received: from laptop-147-210-128-193.labri.fr (HELO nixey) ([147.210.128.193]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 06 Sep 2010 13:52:30 +0200 Resent-To: guile-devel@gnu.org Resent-From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Resent-Date: Mon, 06 Sep 2010 13:52:28 +0200 Resent-Message-ID: <87sk1n6qdf.fsf@gnu.org> Original-Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by imap-ral.inria.fr (Postfix) with ESMTP id 0A18F128E03 for ; Mon, 6 Sep 2010 03:47:05 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhECAGvlg0yMukYKgGdsb2JhbAChCggVAQELCwoYBR2iLIkzghWFPS6IOAEBAwWFOASEQYVX X-IronPort-AV: E=Sophos;i="4.56,322,1280700000"; d="scan'208";a="58590992" Original-Received: from fencepost.gnu.org ([140.186.70.10]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 06 Sep 2010 03:47:03 +0200 Original-Received: from eggs.gnu.org ([140.186.70.92]:43434) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsQnU-0001KO-Eg for ludo@gnu.org; Sun, 05 Sep 2010 21:47:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OsQnU-0002u8-9z for ludo@gnu.org; Sun, 05 Sep 2010 21:47:01 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:35161) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsQnU-0002u0-5N for ludo@gnu.org; Sun, 05 Sep 2010 21:47:00 -0400 Original-Received: by wwb24 with SMTP id 24so5023090wwb.30 for ; Sun, 05 Sep 2010 18:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lZLcjHHhhxoMZVmBbVcEdWRX7i7ndbwv48Gf5pi5aik=; b=IqXA98fT97QR+dfQA/v6tO7wFUK0M2SXXsSUnSKT87qaOSv6Z14zfkayQH1XP82ZJB K8j/k348a6ioApYVgiRCmuCzMGMbYF6lauU5Wo3eECkHcEmMqi49/NLoW/qMHxjq7wPA tQhgnasQtnkhJkAEy7MWt/9ObLQRSqcHmHxds= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=TXscroZr4BTojGqzrgVAflymfx9sGOoaAXZMRUdJdLrSZKVOz6XyW1tfs23suBX1pp 1GjvJf8Yc5rAj8knX3Do5+1NGqaioA0Au0MROB294lbKCupTBvE3iJb7pG5p651CcKt6 UKffr9AhI9nwI/zKGrdvZnfb3FDD+QhI1OhRU= Original-Received: by 10.216.188.132 with SMTP id a4mr982074wen.61.1283737618534; Sun, 05 Sep 2010 18:46:58 -0700 (PDT) Original-Received: by 10.216.12.71 with HTTP; Sun, 5 Sep 2010 18:46:58 -0700 (PDT) In-Reply-To: <877hj0xmcp.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Resent-Date: Mon, 06 Sep 2010 07:52:32 -0400 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10866 Archived-At: On Mon, Sep 6, 2010 at 12:04 AM, Ludovic Court=E8s wrote: > > GNU Guile 1.9 now uses your implementation of =91match=92 as a nice > replacement for Wright=92s implementation, so thank you! > > I stumbled upon this incompatibility: Wright=92s =91match=92 supports =91= ..1=92, > =91..2=92, etc., which mean =931 or more=94, =932 or more=94, etc., and t= he > associated variable (when there=92s one) is bound to the list that > matches: > > =A0(match '(a 1 2) (('a x ..1) x)) > =A0=3D> (1 2) > > AFAICS these patterns aren=92t implemented in your =91match=92. > > Do you have plans to implement them? Yes, these can't be implemented in syntax-rules. It would be straightforward to implement an alternate syntax such as (match '(a 1 2) (('a x .. 1) x)) or generalize it to (match '(a 1 2) (('a x .. ) x)) where the could be #f or left out to mean infinity, which would be strictly more powerful than Wright's syntax. The main reason I haven't bothered adding this is I've never needed it, and was waiting to hear reports from people who do. Do you have any code which actually uses the ..k patterns? :) --=20 Alex