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: vm branch now uses vm repl by default Date: Tue, 09 Sep 2008 19:59:50 +0200 Message-ID: References: <49dd78620809090127y1ffac216ve34cdc5bb2a426ab@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220991770 15646 80.91.229.12 (9 Sep 2008 20:22:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Sep 2008 20:22:50 +0000 (UTC) Cc: guile-devel To: "Neil Jerram" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 09 22:23:45 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kd9jr-0003cG-UF for guile-devel@m.gmane.org; Tue, 09 Sep 2008 22:23:04 +0200 Original-Received: from localhost ([127.0.0.1]:58883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd9iq-00089V-OU for guile-devel@m.gmane.org; Tue, 09 Sep 2008 16:22:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kd9ih-000871-2v for guile-devel@gnu.org; Tue, 09 Sep 2008 16:21:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kd9ib-00083L-O3 for guile-devel@gnu.org; Tue, 09 Sep 2008 16:21:50 -0400 Original-Received: from [199.232.76.173] (port=38894 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd9ib-00082x-JT for guile-devel@gnu.org; Tue, 09 Sep 2008 16:21:45 -0400 Original-Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:43583 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kd9ia-0006An-Os for guile-devel@gnu.org; Tue, 09 Sep 2008 16:21:45 -0400 Original-Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 9070A5A1B0; Tue, 9 Sep 2008 16:21:40 -0400 (EDT) Original-Received: from unquote (251.Red-83-32-65.dynamicIP.rima-tde.net [83.32.65.251]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 707DA5A1AE; Tue, 9 Sep 2008 16:21:38 -0400 (EDT) In-Reply-To: <49dd78620809090127y1ffac216ve34cdc5bb2a426ab@mail.gmail.com> (Neil Jerram's message of "Tue, 9 Sep 2008 09:27:32 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Pobox-Relay-ID: E95ECFBA-7EAC-11DD-A089-D0CFFE4BC1C1-02397024!a-sasl-fastnet.pobox.com X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7645 Archived-At: Hi, On Tue 09 Sep 2008 10:27, "Neil Jerram" writes: > 2008/9/9 Andy Wingo : > >> scheme@(guile-user)> (lambda () (pk a #:bar)) >> $2 = # >> scheme@(guile-user)> ,x $2 >> Disassembly of #: >> >> nargs = 0 nrest = 0 nlocs = 0 nexts = 0 >> >> Bytecode: >> >> 0 (late-variable-ref 0) >> 2 (late-variable-ref 1) >> 4 (object-ref 2) ;; #:bar >> 6 (tail-call 2) >> >> Objects: >> >> 0 #> >> 1 # >> 2 #:bar > > Where in the bytecode is `pk', or some kind of reference to it? It's object 0: scheme@(guile-user)> ,x (lambda () (pk a #:bar)) Disassembly of #: nargs = 0 nrest = 0 nlocs = 0 nexts = 0 Bytecode: 0 (late-variable-ref 0) 2 (late-variable-ref 1) 4 (object-ref 2) ;; #:bar 6 (tail-call 2) Objects: 0 pk 1 a 2 #:bar Sources: 8 #(0 14 #f) The objects are stored in a vector. When late-variable-ref or -set is called and the top of the stack is a symbol, it gets looked up and the resulting variable replaced into where the symbol was. See: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=libguile/vm-i-system.c;h=54689116942bc5d5f942ebcc6500e1e9b610e4c9;hb=refs/heads/vm#l262 Andy -- http://wingolog.org/