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: Wed, 8 Sep 2010 11:18:18 +0900 Message-ID: References: <877hj0xmcp.fsf@gnu.org> <874oe36pgn.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 1283912327 14993 80.91.229.12 (8 Sep 2010 02:18:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Sep 2010 02:18:47 +0000 (UTC) Cc: guile-devel@gnu.org To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Sep 08 04:18:44 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 1OtAFC-0000z8-Rg for guile-devel@m.gmane.org; Wed, 08 Sep 2010 04:18:44 +0200 Original-Received: from localhost ([127.0.0.1]:35158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtAF4-0002Gk-Ho for guile-devel@m.gmane.org; Tue, 07 Sep 2010 22:18:30 -0400 Original-Received: from [140.186.70.92] (port=59367 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtAEw-0002Gf-MH for guile-devel@gnu.org; Tue, 07 Sep 2010 22:18:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtAEt-0002Be-AV for guile-devel@gnu.org; Tue, 07 Sep 2010 22:18:20 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:42656) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtAEt-00028b-54; Tue, 07 Sep 2010 22:18:19 -0400 Original-Received: by mail-ww0-f49.google.com with SMTP id 24so7795570wwb.30 for ; Tue, 07 Sep 2010 19:18:18 -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:cc:content-type :content-transfer-encoding; bh=UcGeXcKZDIWjRoyK6icr2VkOl+VNtNXV8gUjIg3pHnM=; b=Tev6GBYa1YLwmTT0i0+sv+KAhqYgm4TQ/NlwfwwnpfnbG30PYbKDfykCRrGAkXH/rC vyuLOV+4IHj1SGTUTthEunO8HyM6NvVAiCa1QHspGYbgqTAS+ids1lNjjA2FJii7zHYy BkUX4DNa0NO3XdS/Bdv1mMecjRii+bHvQly9A= 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 :cc:content-type:content-transfer-encoding; b=I6tcKBIMX/OBlBU6/ZsN70MpiQsCVDpBCxUoo/w+egJgS/a65bWJ/B+TY6h9HTtbE9 qOXPcpvz7v3k6LcUbhl5gy2Q+IOwchLXfvS0suKPuU6lvOpLsvjcQpYUeOJjt0gWBb20 FEol7069NrXQ0SJjl5jtUc5NcVxRJh7q4z+DA= Original-Received: by 10.216.72.16 with SMTP id s16mr195062wed.20.1283912298698; Tue, 07 Sep 2010 19:18:18 -0700 (PDT) Original-Received: by 10.216.12.71 with HTTP; Tue, 7 Sep 2010 19:18:18 -0700 (PDT) In-Reply-To: <874oe36pgn.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:10889 Archived-At: On Mon, Sep 6, 2010 at 9:12 PM, Ludovic Court=E8s wrote: > > Well, since there are only 9 of them, they could probably be implemented > as special cases, with an augmented =91match-gen-ellipses=92, which would= be > told the minimum number of elements expected? Oh, the Wright syntax limited you to 9 forms, so "..10" is illegal? Then this could be done in pure syntax-rules. >> Do you have any code which actually uses the ..k >> patterns? :) > > I do! =A0:-) > > =A0http://git.sv.gnu.org/cgit/guile-rpc.git/tree/modules/rpc/compiler.scm= #n312 > > Well it uses only =91..1=92. =A0The same code would work with =91..1=92 r= eplaced > by =91...=92, but then errors in the input wouldn=92t be detected as nice= ly. "..1" is actually useful - it's the analog of "+" in regular expressions, and allows simplifying many syntax-rules patterns you see written (elt0 elt1 ...) as (elt ..1). If the elements are more complex patterns this is a big win. --=20 Alex