From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bajcik@kolos.math.uni.lodz.pl (Krzysztof Garus) Newsgroups: gmane.lisp.guile.user Subject: Re: one C function to many Scheme functions Date: Thu, 9 Jan 2003 11:26:22 +0100 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <20030109102622.GA7713@kolos.math.uni.lodz.pl> References: <20030106203029.GA11033@gosia> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 X-Trace: main.gmane.org 1042108071 4536 80.91.224.249 (9 Jan 2003 10:27:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 9 Jan 2003 10:27:51 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18WZuf-0001B1-00 for ; Thu, 09 Jan 2003 11:27:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WZvQ-0007QK-03 for guile-user@m.gmane.org; Thu, 09 Jan 2003 05:28:36 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18WZuk-0007A8-00 for guile-user@gnu.org; Thu, 09 Jan 2003 05:27:54 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18WZuB-0006ZL-00 for guile-user@gnu.org; Thu, 09 Jan 2003 05:27:20 -0500 Original-Received: from kolos.math.uni.lodz.pl ([212.191.65.6]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WZtJ-0005o0-00 for guile-user@gnu.org; Thu, 09 Jan 2003 05:26:25 -0500 Original-Received: by kolos.math.uni.lodz.pl (Postfix, from userid 500) id 2D95836C21; Thu, 9 Jan 2003 11:26:22 +0100 (CET) Original-To: guile-user@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1513 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1513 On Wed, Jan 08, 2003 at 08:45:43PM +0000, Neil Jerram wrote: > >>>>> "bajcik" == bajcik writes: > > bajcik> But I want to declare many functions in a loop. I have a > bajcik> table of names and a table of C-functions [ mytype_t > bajcik> function(my_type arg) ] and only ONE C-function that > bajcik> converts SCM to mytype_t. It is a wrapper. > > Guile does not have anything like gh_new_procedure_data. However your > general objective can easily be achieved like this ... [ cut ] > Then in Scheme: > > (define (name0 arg) (wrapper arg 0)) > (define (name1 arg) (wrapper arg 1)) > (define (name2 arg) (wrapper arg 2)) > ... > > Does this help? I am using similar workaround on similar concept, also with definitions. Last question: what is cost this definition? I suppose it is small, but if I call Scheme callback very frequent? bajcik (not English spoken :> ) -- Krzysztof Garus Linux User 171721 Stronka: http://kolos.math.uni.lodz.pl/~bajcik/ Polecam: http://kolos.math.uni.lodz.pl/~bajcik/duskc/ _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user