From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pierre LINDENBAUM Newsgroups: gmane.lisp.guile.user Subject: function registered with scm_c_define_gsubr: how can i handle an optional parameter? Date: Wed, 13 Dec 2017 22:50:17 +0100 Organization: UFR MEDECINE/INSTITUT DU THORAX/UMR_S 1087 I. THORAX Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1513202231 17278 195.159.176.226 (13 Dec 2017 21:57:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Dec 2017 21:57:11 +0000 (UTC) User-Agent: Roundcube Webmail/1.1.2 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Dec 13 22:57:08 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePF1X-0004FE-9a for guile-user@m.gmane.org; Wed, 13 Dec 2017 22:57:07 +0100 Original-Received: from localhost ([::1]:37933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePF1e-000291-6p for guile-user@m.gmane.org; Wed, 13 Dec 2017 16:57:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePF1J-00028q-Im for guile-user@gnu.org; Wed, 13 Dec 2017 16:56:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePF1F-0005tL-CW for guile-user@gnu.org; Wed, 13 Dec 2017 16:56:53 -0500 Original-Received: from smtp2.univ-nantes.fr ([193.52.82.19]:37150 helo=smtp-prv.univ-nantes.fr) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePF1F-0005qa-1H for guile-user@gnu.org; Wed, 13 Dec 2017 16:56:49 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by smtp-prv.univ-nantes.fr (Postfix) with ESMTP id AF5F9AD03A2 for ; Wed, 13 Dec 2017 22:50:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=univ-nantes.fr; s=mail; t=1513201817; bh=LkkIhIxf8nU2Fus1uFLaqMWi/Njnihz3HfiLr0fxusc=; h=Date:From:To:Subject:From; b=GtIBAT9+YDgFAo8zaMUQacYiUTIoc9PHu0Sg3eXXbB61zTa5WhT41xs18EU2aZ79S Nb+fLZplixwA5uL6HLrj1NS4QBk74AYEOtq2Bsvp5cCUjG5/BhrYPZNCtzZJrQdPBY 3bdBPHs/thLdyvH4yn9FinzscBTfOKIsErXkgNbg= X-Virus-Scanned: Debian amavisd-new at smtp2 Original-Received: from smtp-prv.univ-nantes.fr ([127.0.0.1]) by localhost (smtp2.u12.univ-nantes.prive [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Uhy-BFF7lVxL for ; Wed, 13 Dec 2017 22:50:17 +0100 (CET) Original-Received: from webmail.univ-nantes.fr (webmail2-lmb.cprv.univ-nantes.prive [172.26.0.61]) by smtp-prv.univ-nantes.fr (Postfix) with ESMTP id 82409AD038E for ; Wed, 13 Dec 2017 22:50:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=univ-nantes.fr; s=mail; t=1513201817; bh=LkkIhIxf8nU2Fus1uFLaqMWi/Njnihz3HfiLr0fxusc=; h=Date:From:To:Subject:From; b=GtIBAT9+YDgFAo8zaMUQacYiUTIoc9PHu0Sg3eXXbB61zTa5WhT41xs18EU2aZ79S Nb+fLZplixwA5uL6HLrj1NS4QBk74AYEOtq2Bsvp5cCUjG5/BhrYPZNCtzZJrQdPBY 3bdBPHs/thLdyvH4yn9FinzscBTfOKIsErXkgNbg= X-Sender: Pierre.Lindenbaum@univ-nantes.fr X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 193.52.82.19 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.lisp.guile.user:14348 Archived-At: Hi all, (cross posted on SO: https://stackoverflow.com/questions/47797521 ) I've defined a guile C function: static SCM myfun(SCM arg1,SCM opt_arg2) { return SCM_BOOL_T; } registered with scm_c_define_gsubr ("myfun", 1, 1, 0, myfun); there is one optional argument. How can I detect if opt_arg2 has been used ? in (myfun 1) or (myfun 1 2) Thanks !