From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Han-Wen Nienhuys Newsgroups: gmane.lisp.guile.user Subject: memory costs of storing lambdas? Date: Wed, 30 Apr 2003 13:06:39 +0200 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <16047.44607.580379.626517@localhost.localdomain> Reply-To: hanwen@cs.uu.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1051703211 26819 80.91.224.249 (30 Apr 2003 11:46:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 30 Apr 2003 11:46:51 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Apr 30 13:46:48 2003 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 19Aq2y-0006y9-00 for ; Wed, 30 Apr 2003 13:46:48 +0200 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 19ApyF-0002RE-01 for guile-user@m.gmane.org; Wed, 30 Apr 2003 07:41:55 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19Aps8-0007Xi-00 for guile-user@gnu.org; Wed, 30 Apr 2003 07:35:36 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19AprD-0006bc-00 for guile-user@gnu.org; Wed, 30 Apr 2003 07:34:40 -0400 Original-Received: from smtpzilla2.xs4all.nl ([194.109.127.138]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19ApFy-0005mT-00 for guile-user@gnu.org; Wed, 30 Apr 2003 06:56:10 -0400 Original-Received: from localhost.localdomain.xs4all.nl (byrd.xs4all.nl [213.84.26.127]) by smtpzilla2.xs4all.nl (8.12.9/8.12.9) with ESMTP id h3UAu5ZX029402 for ; Wed, 30 Apr 2003 12:56:05 +0200 (CEST) Original-To: guile-user@gnu.org X-Mailer: VM 7.14 under Emacs 21.2.1 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:1884 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1884 (please CC replies, I'm not subscribed to guile-user) Hi there, I have a small question: I was wondering how much memory it costs to store an anonymous function. I have to make choices between storing various entities in lilypond either as a function, or as an expression. The following fictional example illustrates the distinction (# introduces in-line Scheme in Lilypond syntax): 1. using anon functions: (define (style-setter style) (lambda (head) (set-note-head-style head style))) ... \property Voice.NoteHead \set #'style-procedure = #(style-setter "cross") During the lilypond run, the anonymous function is called. Storage cost: one anonymous function 2. using expressions \property Voice.NoteHead \set #'style-expression = #(list set-note-head-style "cross") During the lilypond-run, a note-head pointer is prepended to the argument list, and the list (set-note-head-style head style) is evaluated. Storage cost: a list of length 2. I have the feeling that solution 1. is more expensive in terms of memory than solution 2. My question: is this true, and how could I have found out this answer myself? (i.e. where is the related interpreter code?) Thanks, Han-Wen -- Han-Wen Nienhuys | hanwen@cs.uu.nl | http://www.cs.uu.nl/~hanwen _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user