From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.user Subject: Re: passing flags to a function Date: Wed, 03 May 2006 11:43:20 +1000 Message-ID: <87mzdz993b.fsf@zip.com.au> References: <44574FA0.1050108@mtl.mit.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146620623 4632 80.91.229.2 (3 May 2006 01:43:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 May 2006 01:43:43 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed May 03 03:43:41 2006 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fb6Ou-0004AS-Ks for guile-user@m.gmane.org; Wed, 03 May 2006 03:43:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fb6Ou-0000Fx-50 for guile-user@m.gmane.org; Tue, 02 May 2006 21:43:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fb6Oq-0000F6-JA for guile-user@gnu.org; Tue, 02 May 2006 21:43:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fb6Op-0000Ej-As for guile-user@gnu.org; Tue, 02 May 2006 21:43:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fb6Op-0000Eg-6R for guile-user@gnu.org; Tue, 02 May 2006 21:43:31 -0400 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fb6P6-0004lq-48 for guile-user@gnu.org; Tue, 02 May 2006 21:43:48 -0400 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout1.pacific.net.au (Postfix) with ESMTP id 9E781328C36; Wed, 3 May 2006 11:43:29 +1000 (EST) Original-Received: from localhost (ppp24A6.dyn.pacific.net.au [61.8.36.166]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k4316HHZ029011; Wed, 3 May 2006 11:06:18 +1000 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1Fb6Oe-0001mk-00; Wed, 03 May 2006 11:43:20 +1000 Original-To: Dan McMahill In-Reply-To: <44574FA0.1050108@mtl.mit.edu> (Dan McMahill's message of "Tue, 02 May 2006 08:25:04 -0400") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) 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:5279 Archived-At: Dan McMahill writes: > > SCM scm_myfn(SCM flags) > { > myfn (scm_num2int (flags, SCM_ARG1, "myfn")); Various things in the guile core are done like that, stuff like O_RDWR for `open'. The list of symbols Ludovic described is done in the guile-gtk interface and works nicely too. If you're entirely in scheme then the ice-9 optargs module to take keywords is good, especially if you want actual values, not just yes/no flags. (foo #:error-check #t #:verbose #f ...) _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user