From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Question About the Variable Allocator Date: Sun, 03 Jun 2012 23:30:41 +0200 Message-ID: <87hausnkvy.fsf@pobox.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1338759063 6516 80.91.229.3 (3 Jun 2012 21:31:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 3 Jun 2012 21:31:03 +0000 (UTC) Cc: guile-devel To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jun 03 23:31:00 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SbINy-0003qB-9s for guile-devel@m.gmane.org; Sun, 03 Jun 2012 23:30:54 +0200 Original-Received: from localhost ([::1]:50997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbINx-000420-Qe for guile-devel@m.gmane.org; Sun, 03 Jun 2012 17:30:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbINu-00041u-R7 for guile-devel@gnu.org; Sun, 03 Jun 2012 17:30:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbINs-00089B-Vg for guile-devel@gnu.org; Sun, 03 Jun 2012 17:30:50 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:48457 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbINs-00088n-Mv for guile-devel@gnu.org; Sun, 03 Jun 2012 17:30:48 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 4C517A1CC; Sun, 3 Jun 2012 17:30:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=bpi+N1rGhuFOpSqmdDEgFHJ2OUI=; b=TTfg93 wt21UUX8jnoIgVefIamLLvrDIvlqyF71NWtbZ4KWbw1jrZK+jX2iDhuLKUzQYQtk ibRGyw/YHlwJVAe47mFSxSd2Q24sb2+KuaMipqgd7JajJcXoqwOBMzCDB3aXRnqQ pspnz7puYoZw8I3X4HD6PhIWQCsluI83p9RBw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=RknLAC2HlBkabKevrvkAXiRKDsVRyjdu DlZOVa+wiGaIncTIvOVsQmLaXoxQcWJ1HJ1EmfTe33TG5IWEkKAtIfBymCK4a6GP UtfnA6qSr73HxbDcqe5VhyEJ3AeXRAi5QqzMeOjjbWIGp4aXbQvVdCLkNwuPs9Mz 5Gqwhp+ivNs= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 44189A1CB; Sun, 3 Jun 2012 17:30:45 -0400 (EDT) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 8F8A2A1CA; Sun, 3 Jun 2012 17:30:44 -0400 (EDT) In-Reply-To: (Noah Lavine's message of "Sun, 3 Jun 2012 10:20:12 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Pobox-Relay-ID: 6090B168-ADC3-11E1-9E27-E981AF15ED39-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14549 Archived-At: Hi Noah, On Sun 03 Jun 2012 16:20, Noah Lavine writes: > I've always been puzzled about part of the variable allocator. In > module/language/tree-il/analyze.scm, we deal with allocations, which > are hash tables that say where in the stack each local variable goes. > The maps are two level, symbol -> {lambda -> location}. The reason > given is that different lambdas could have different variables with > the same symbol. > > But if I understand correctly, each variable also gets a gensym, and > the gensyms are globally unique. So wouldn't it be possible to use the > gensyms as keys instead, and only have a single level map? If so, why > don't we do it? AFAIR the reason is not to permit multiple lexically bound variables with the same gensym, but to provide for different allocations of the same variable in different closures. Thus a variable might be at local 5 in one closure, free variable 3 in another, free variable 6 in another, etc. Cheers, Andy -- http://wingolog.org/