From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [BUG] Eval sets incorrect runtime metainformation Date: Wed, 26 Jun 2024 11:24:47 +0200 Message-ID: <87msn86ops.fsf@igalia.com> References: <87bk3pkqmt.fsf@trop.in> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19428"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: guile-devel@gnu.org To: Andrew Tropin Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jun 26 11:25:11 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sMOtr-0004lX-5V for guile-devel@m.gmane-mx.org; Wed, 26 Jun 2024 11:25:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMOta-0006QQ-23; Wed, 26 Jun 2024 05:24:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMOtZ-0006QH-Do for guile-devel@gnu.org; Wed, 26 Jun 2024 05:24:53 -0400 Original-Received: from fforwardh3-smtp.messagingengine.com ([103.168.172.198]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMOtX-0000UG-Hv for guile-devel@gnu.org; Wed, 26 Jun 2024 05:24:53 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfforwardh.nyi.internal (Postfix) with ESMTP id B9F0029201A6; Wed, 26 Jun 2024 05:24:50 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 26 Jun 2024 05:24:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1719393890; x=1719480290; bh=TJlvKjRBF5o8C48l/Kb8uQ3PWeXh RUgHi4GwIXTJDkE=; b=uVavz5I1VjeZkefqa/TU1QT79IHvDaA8sfcGa3v47Igk weH2cVMQlNfdrKNfsvtrq+Ew1GM2dxWebzki4c5De4OUBedf769d0nint2Dy9Q0L na7jox5MB9X5zILd+1IKniTFab7UfoCjjxqjZZTphQalrOy/DmO9hunuxklUZTc/ cFe4/PTfYMZK6wUlRnyUgve70y3XC/jTQ1mqJh3oe4wsB/1qDx4QhH9ZQd1EgfTC wAcAwkf1QI/SifWJyjLBuRSZIY+Wg3VdWmXD/jYAQVC5wsbHILKgrc6alNNJ8wAo lHWrs0Q3pd/dhoRigF2Ovfe/IF3H3WBdlU/zfZLErg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtddvgdduhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhffkfgfgggtsehttdertddtredtnecuhfhrohhmpeetnhguhicu hghinhhgohcuoeifihhnghhosehpohgsohigrdgtohhmqeenucggtffrrghtthgvrhhnpe eigfffudefieettdfhleevteeigedvkeffkedtieevteeugfejfeehuedtjeegjeenucff ohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpeifihhnghhosehpohgsohigrdgtohhm X-ME-Proxy: Feedback-ID: i0cba4195:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Jun 2024 05:24:49 -0400 (EDT) In-Reply-To: <87bk3pkqmt.fsf@trop.in> (Andrew Tropin's message of "Tue, 25 Jun 2024 19:07:22 +0400") Received-SPF: neutral client-ip=103.168.172.198; envelope-from=wingo@pobox.com; helo=fforwardh3-smtp.messagingengine.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22479 Archived-At: Hello, On Tue 25 Jun 2024 17:07, Andrew Tropin writes: > (use-modules (system vm program) > (ice-9 eval-string)) > > (eval-string "(define (test-fn) 'hey)" > #:file "hello.scm" > #:line 1 > #:column 1 > #:compile? #f) > > (format #t "~a\n" (program-sources test-fn)) > ;; ((0 ice-9/eval.scm 329 . 13) (12 ice-9/eval.scm 330 . 21) (44 ice-9/eval.scm 330 . 15)) What you are seeing here is that in general the debugging experience is different for interpreted and compiled procedures. For example, you will not be able to set a breakpoint in interpreted code, because the code for the closure that is part of `eval` corresponds to potentially many different functions. program-sources will only work usefully on compiled procedures. https://www.gnu.org/software/guile/manual/html_node/Compiled-Procedures.html. I would suggest that if you are working on a rich IDE, that you pass #:compile? #t. Nothing else will work as you like. That said, the evaluator does attach so-called "meta-data" information to procedures, such as the procedure name. https://www.gnu.org/software/guile/manual/html_node/Procedure-Properties.html. If you know that you are making a procedure you can insert some meta-data for use by your run-time, in an initial vector alist. See https://www.gnu.org/software/guile/manual/html_node/Procedure-Properties.html. But that's limited and doesn't take macros, etc into account. Regards, Andy