From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price <ianprice90@googlemail.com> Newsgroups: gmane.lisp.guile.user Subject: Re: syntax-case guards Date: Mon, 04 Feb 2013 01:14:57 +0000 Message-ID: <8738xc2832.fsf@Kagami.home> References: <CA+XASoXBELxXxy=Br9cAjmoVra5Q4rdb4v5LafCwK4g=RQpWAg@mail.gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1359940774 22701 80.91.229.3 (4 Feb 2013 01:19:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Feb 2013 01:19:34 +0000 (UTC) Cc: guile-user <guile-user@gnu.org> To: Aleix Conchillo =?iso-8859-1?Q?Flaqu=E9?= <aconchillo@gmail.com> Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Feb 04 02:19:54 2013 Return-path: <guile-user-bounces+guile-user=m.gmane.org@gnu.org> Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from <guile-user-bounces+guile-user=m.gmane.org@gnu.org>) id 1U2Aiw-0004qN-AD for guile-user@m.gmane.org; Mon, 04 Feb 2013 02:19:54 +0100 Original-Received: from localhost ([::1]:42472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <guile-user-bounces+guile-user=m.gmane.org@gnu.org>) id 1U2Aid-00030p-Pw for guile-user@m.gmane.org; Sun, 03 Feb 2013 20:19:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <ianprice90@googlemail.com>) id 1U2AiY-0002w4-SC for guile-user@gnu.org; Sun, 03 Feb 2013 20:19:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <ianprice90@googlemail.com>) id 1U2AeH-0002FQ-1x for guile-user@gnu.org; Sun, 03 Feb 2013 20:15:06 -0500 Original-Received: from mail-wg0-f53.google.com ([74.125.82.53]:36034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ianprice90@googlemail.com>) id 1U2AeG-0002B1-NG for guile-user@gnu.org; Sun, 03 Feb 2013 20:15:04 -0500 Original-Received: by mail-wg0-f53.google.com with SMTP id fn15so4379509wgb.20 for <guile-user@gnu.org>; Sun, 03 Feb 2013 17:15:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=Q7Xunwv5xCMvsi6xgnQfns857zAsjaPmD6OBIFHtQZg=; b=iKGjoKYS/QyQXlTkK+89YYb9cWexDC6u0Un5lTWAX0oV2hEyS9VpDdMX3sSs6L86f0 klDWQ8CwkNXc/hfbA/iAKVTeO8T6BuhqZoWY9LyChS4rrcT3QRu+YtAF7M6rsqWSiGlZ lTT9RgubrQ7qkC6xQ6/M9jg8Qg2AD1pfTfqJxgw+PKH8vq/e2nlJa4Ojqkv6+0DMLBKF l/Q7ngUOKPwDmbuAqGmp1h89OTHOjIjBsUidK4bEaViTEeZqp1c3r/YUsrz8c+72IBp4 3x0dH8mtL6e9WTmY5TTIbwa42ew1pt5JgtQlX8TPOStCvp8jR/OzuCKEhHRv+Gn5kjdO b6HA== X-Received: by 10.194.123.105 with SMTP id lz9mr32197387wjb.43.1359940503417; Sun, 03 Feb 2013 17:15:03 -0800 (PST) Original-Received: from Kagami.home (host86-168-32-206.range86-168.btcentralplus.com. [86.168.32.206]) by mx.google.com with ESMTPS id df2sm17277537wib.0.2013.02.03.17.15.01 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 03 Feb 2013 17:15:01 -0800 (PST) In-Reply-To: <CA+XASoXBELxXxy=Br9cAjmoVra5Q4rdb4v5LafCwK4g=RQpWAg@mail.gmail.com> ("Aleix Conchillo =?iso-8859-1?Q?Flaqu=E9=22's?= message of "Sun, 3 Feb 2013 15:56:38 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.82.53 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions <guile-user.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guile-user>, <mailto:guile-user-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/guile-user> List-Post: <mailto:guile-user@gnu.org> List-Help: <mailto:guile-user-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guile-user>, <mailto:guile-user-request@gnu.org?subject=subscribe> Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10007 Archived-At: <http://permalink.gmane.org/gmane.lisp.guile.user/10007> Aleix Conchillo Flaqu=E9 <aconchillo@gmail.com> writes: > Hi, > > I'm trying to use a syntax-case guard when the pattern has ellipsis. > So I have something like, > > ((_ (struct (k v) ...)) > (string? (syntax->datum #'k)) > exp) You were probably wanting this to apply to each and every k individually? syntax-case does not work this way. Patterns with ellipsis are expected to be matched with templates with ellipsis. Sorry. > So, how do I make the guard when I have a pattern with ellipsis? using every from (srfi srfi-1) or for-all from (rnrs lists) [same procedure different name] you get (every (compose string? syntax->datum) #'(k ...)) As an aside, this won't work in Racket, since they also make lists into syntax objects, unlike psyntax or the r6rs. --=20 Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"