From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.user Subject: Re: case-lambda* question Date: Thu, 15 Nov 2012 09:22:14 +0800 Message-ID: References: <7A088671-9922-4ECF-A5C5-841AEFDBCA80@bluewin.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1352942546 32187 80.91.229.3 (15 Nov 2012 01:22:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Nov 2012 01:22:26 +0000 (UTC) Cc: guile-user@gnu.org To: Daniel Llorens Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Nov 15 02:22:37 2012 Return-path: 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 ) id 1TYoA7-00040p-Uq for guile-user@m.gmane.org; Thu, 15 Nov 2012 02:22:36 +0100 Original-Received: from localhost ([::1]:41938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYo9y-0003m4-1L for guile-user@m.gmane.org; Wed, 14 Nov 2012 20:22:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYo9r-0003lS-Ee for guile-user@gnu.org; Wed, 14 Nov 2012 20:22:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYo9o-0001D0-CU for guile-user@gnu.org; Wed, 14 Nov 2012 20:22:19 -0500 Original-Received: from mail-wi0-f169.google.com ([209.85.212.169]:64455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYo9o-0001Ci-6T for guile-user@gnu.org; Wed, 14 Nov 2012 20:22:16 -0500 Original-Received: by mail-wi0-f169.google.com with SMTP id x18so2266937wia.0 for ; Wed, 14 Nov 2012 17:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=hQULTIwEtYwSyzbgfaCUsj0vgFWqLTc8YgwYa/LGsEc=; b=vPBOZrB5ycDkrppTLCfRJ2627BvuH6vX6KU/K7eqD+1Drqxldn+gP7Jik1xm8LTn9h y2Pg/ZR61/fMCIsNmzzousTsr4dE0nQ8VO/DDbkHE/JnvViuxdTm63PZDyWbCZv3NAIz cS1ytG1w2zPj9iOXIkEEmGF4ydZvCCuuDssbOYXQeGvqY7sbXo85t6Ye/XDSWN//n62h qYNwHXmjQYSWQ+OsskqB/jjtzZ0/iv4IOFDgm5t8GTlI2lVwrCWiSwMlHbHx0B3Ch9h+ DmW7bSjxxxhRWio0L/3EbSdK183CWIjCOMpzewszQZy5W4wDdQUFZRl2OZFK4L9UAadP Cbpw== Original-Received: by 10.180.19.73 with SMTP id c9mr28510076wie.8.1352942534888; Wed, 14 Nov 2012 17:22:14 -0800 (PST) Original-Received: by 10.217.53.133 with HTTP; Wed, 14 Nov 2012 17:22:14 -0800 (PST) In-Reply-To: <7A088671-9922-4ECF-A5C5-841AEFDBCA80@bluewin.ch> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.169 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:9683 Archived-At: On 14 November 2012 18:20, Daniel Llorens wrote= : >> When the doc. states keyword arguments do not contribute to the >> success of a match, it refers only to keyword arguments in the >> case-lambda clause, not at the call site. This makes sense, otherwise >> it would inhibit writing functions that detect keywords internally >> from their rest arguments. > > Do you mean something like this? > > (define* (f a #:key x) x) > (define (g . args) (apply f args)) > (g 0) -> #f > (g 0 #:x #t) -> #t > > i.e. g must accept being called with 3 'arguments' so that it can forward= the keyword args. I was thinking of: (define f (case-lambda* ((a . rest) (if (memq #:x rest) =E2=80=A6 where #:x is picked up from inside rest. Based on the other error, I'd say that any case-lambda* with keyword arguments is matched with a rest argument instead, i.e. =E2=80=9Ca #:key x= =E2=80=9D is treated as =E2=80=9Ca . rest=E2=80=9D.