From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Llorens Newsgroups: gmane.lisp.guile.user Subject: case-lambda* question Date: Mon, 12 Nov 2012 14:54:45 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1352728501 17994 80.91.229.3 (12 Nov 2012 13:55:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2012 13:55:01 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 12 14:55:12 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 1TXuTm-0006ML-GJ for guile-user@m.gmane.org; Mon, 12 Nov 2012 14:55:10 +0100 Original-Received: from localhost ([::1]:49192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXuTc-0004Zv-RQ for guile-user@m.gmane.org; Mon, 12 Nov 2012 08:55:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXuTV-0004ZI-NY for guile-user@gnu.org; Mon, 12 Nov 2012 08:54:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXuTS-00042q-Le for guile-user@gnu.org; Mon, 12 Nov 2012 08:54:53 -0500 Original-Received: from zhbdzmsp-smta17.bluewin.ch ([195.186.99.133]:50582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXuTS-00042H-Ea for guile-user@gnu.org; Mon, 12 Nov 2012 08:54:50 -0500 Original-Received: from [195.186.227.131] ([195.186.227.131:50155] helo=zhhdzmsp-smta14.bluewin.ch) by zhbdzmsp-smta17.bluewin.ch (envelope-from ) (ecelerity 2.2.3.47 r(39824M)) with ESMTP id 36/65-25886-7AFF0A05; Mon, 12 Nov 2012 13:54:47 +0000 Original-Received: from [10.23.3.29] (128.179.67.121) by zhhdzmsp-smta14.bluewin.ch (8.5.142) (authenticated as dll@bluewin.ch) id 509AC489005EFC73 for guile-user@gnu.org; Mon, 12 Nov 2012 13:54:47 +0000 X-Mailer: Apple Mail (2.1085) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.186.99.133 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:9665 Archived-At: (define f (case-lambda* ((a b c #:key x) 3) ((a #:key x) 1))) scheme@(guile-user)> (g 0 #:x 1) $1 =3D 3 The manual says > Also, for completeness. Guile defines case-lambda* as well, which is = like case-lambda, except with lambda* clauses. A case-lambda* clause = matches if the arguments fill the required arguments, but are not too = many for the optional and/or rest arguments. >=20 > Keyword arguments are possible with case-lambda*, but they do not = contribute to the =93matching=94 behavior. That is to say, case-lambda* = matches only on required, optional, and rest arguments, and on the = predicate; keyword arguments may be present but do not contribute to the = =93success=94 of a match. In fact a bad keyword argument list may cause = an error to be raised. I see that it gives 3 because =91a b c=92 matches =910 #:x 1=92, so it's = counting #:x as an =91argument=92 by itself. This is not what I expected = from the description above. I think that the description should make = clear that each item in the arg list is counted as an argument for the = purposes of matching. Moreover I think this behavior makes case-lambda* fairly useless, or = even treacherous. I wonder what other people think. Regards, Daniel =20=