From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: guign@mails.selgrad.org Newsgroups: gmane.lisp.guile.user Subject: scm_c_make_gsubr parameters Date: Wed, 30 Dec 2009 23:00:38 +0100 Message-ID: <20091230220038.GA5642@shoikan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1262211292 309 80.91.229.12 (30 Dec 2009 22:14:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Dec 2009 22:14:52 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Dec 30 23:14:43 2009 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NQ6oU-0005co-NG for guile-user@m.gmane.org; Wed, 30 Dec 2009 23:14:42 +0100 Original-Received: from localhost ([127.0.0.1]:36998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQ6bB-0004j6-2F for guile-user@m.gmane.org; Wed, 30 Dec 2009 17:00:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQ6b7-0004hM-1j for guile-user@gnu.org; Wed, 30 Dec 2009 17:00:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQ6b2-0004cP-3F for guile-user@gnu.org; Wed, 30 Dec 2009 17:00:52 -0500 Original-Received: from [199.232.76.173] (port=56115 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQ6b1-0004cM-UU for guile-user@gnu.org; Wed, 30 Dec 2009 17:00:47 -0500 Original-Received: from smtprelay02.ispgateway.de ([80.67.18.44]:41538) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NQ6b1-0003Fa-Ir for guile-user@gnu.org; Wed, 30 Dec 2009 17:00:47 -0500 Original-Received: from [84.56.123.144] (helo=localhost) by smtprelay02.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1NQ6ax-00089o-Rf; Wed, 30 Dec 2009 23:00:43 +0100 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Df-Sender: 778998 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7590 Archived-At: Hello all :) I just found that guile does not like primitive procedures with a lot of arguments. ERROR in scm_c_make_gsubr: too many args (11) func The (procedure-properties) show correct arities, e.g. scm_c_define_gsubr(..., 9, 0, 0, ...) (arity 9 0 #f) scm_c_define_gsubr(..., 10, 0, 0, ...) (arity 10 0 #f) For most values I get a meaningful error message: scm_c_define_gsubr(..., 11, 0, 0, ...) too many args (11) ... scm_c_define_gsubr(..., 15, 0, 0, ...) too many args (15) Interestingly the following happens at 16 (my actual case): scm_c_define_gsubr(..., 16, 0, 0, ...) (arity 0 1 #f) scm_c_define_gsubr(..., 17, 0, 0, ...) (arity 1 1 #f) >From 18 on everything is back to normal scm_c_define_gsubr(..., 18, 0, 0, ...) too many args (18) ... I think the case with 16 is clear, but I neither found the limit of 10, nor the special case of 16 documented in the guile 1.8.5 manual (the version I'm using). So this might be something to help confused people around section 5.8.2 "Primitive Procedures". :) In my case of 16 arguments I got the error "Invalid Number of Arguments" when calling my procedure. I counted a lot today... ;) And yes, 16 parameters is really insane, I know. I was just hacking a little piece of test code and didn't want to look the C list functions up. If i would have written clean code I might have never stumbled across it :) Have a nice time :) Kai.