From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.devel Subject: Re: unhandled constant? Date: Sat, 01 Feb 2020 14:16:36 +0100 Message-ID: References: <8d77f905-31e9-4d0b-973a-82be38360e07@www.fastmail.com> <877e16wolr.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="111502"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.1.7-781-gfc16016-fmstable-20200127v1 Cc: guile-devel@gnu.org, Han-Wen Nienhuys To: "David Kastrup" Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Feb 01 14:17:16 2020 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 1ixseB-000SpE-In for guile-devel@m.gmane-mx.org; Sat, 01 Feb 2020 14:17:15 +0100 Original-Received: from localhost ([::1]:46218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixseA-0006vD-Ir for guile-devel@m.gmane-mx.org; Sat, 01 Feb 2020 08:17:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37591) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixsdw-0006uz-SY for guile-devel@gnu.org; Sat, 01 Feb 2020 08:17:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixsdv-0008CL-U5 for guile-devel@gnu.org; Sat, 01 Feb 2020 08:17:00 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:35903) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ixsdu-00089V-Bj; Sat, 01 Feb 2020 08:16:58 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id EC4792213F; Sat, 1 Feb 2020 08:16:57 -0500 (EST) Original-Received: from imap1 ([10.202.2.51]) by compute3.internal (MEProxy); Sat, 01 Feb 2020 08:16:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=1C84faOG5BYZJ8dS+8NUhMOnTO6Undz TP4MQb4Zpvhw=; b=S9x2h39btqekt8P3wiGdaSjc37+U0znaADk6bZTu1FD2ZAn LmzcQE6g+euT9p2dLgB5NbOGzUMYzN+MgyoNrIH5ZUZH58oz22xV/lBWWDRxNnpb 1sbhRA3ir7Ab+sJOZjkADN2ysGvVBjWEmmFyuE7CESfgZRYNNZ+LxHY9NRhVQaD9 YBoLajSMXvpeGfMpoHenAaLLYFs9w9jH1P6BWbxAs9eiP5ueVAdyjA9OZwW2bj24 nfTgJNqWtz6GvY6DUvuGVjWMozvmepO6tfrH5EnTXeyYap0gMcUWnwZpV+Js5Ey9 ra5+F9X9XPDNigkdtHV1nfEnHwp026nGKTWV41A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=1C84fa OG5BYZJ8dS+8NUhMOnTO6UndzTP4MQb4Zpvhw=; b=eLAEcEndNaiNJbVyVy8DUm +jg7lQOxV53/ccNPLJ+V0cQ91zc+xYEzWoN8PWxmR8wu2KaI752P+b83ZRSl0H5z YY7df+O4igKk4f0qPWtN9I3/pi6ggaP8VhUk/K89UyqWZCDZvlqJ8E0wVc6gAA/z WvnLL4cXp7sGKodlmTXSSQq0Fi2VUZ3NrWbexjTe1iyubhK1gsJfJ4DuPpDFhZr3 CJY3PdLyPWpeWzgzO1YeovNUTDgoyQfiW11yD5QDAuA5tJbxigPBk7qOUJyJVDOo +S5stP9WYynnnN6ZSW+DDkRWdx2ZatNF9MaFAD+5mqrkZk6/ke7OUkEWDFJwv7rg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrgedvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderreejnecuhfhrohhmpefnihhnuhhs pgeujhpnrhhnshhtrghmuceolhhinhhushdrsghjohhrnhhsthgrmhesvhgvrhihfhgrsh htrdgsihiiqeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghrhihfrghsthdrsghiii X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8A93AC200A4; Sat, 1 Feb 2020 08:16:57 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <877e16wolr.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.26 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.lisp.guile.devel:20372 Archived-At: On Sat, 1 Feb 2020, at 12:09, David Kastrup wrote: > > Can you expand about the "expansion time and macro time separation"? > > If we have > > (define decl '()) > (define (make-var n v) (list "var" n v)) > (defmacro define-session (name value) > (define (inner n v) > (set! decl > (cons > (make-var n v) > decl)) > ) > `(,inner ',name ,value)) > (define-session foo 1) > (display decl) > (newline) > > as stated, the local function "inner" is defined at macro time, but the > form > `(,inner ',name ,value) > does not export the _name_ inner but rather the defined function. That > part naively appears to me like it should work; an "expansion time and > macro time" issue appears rather to be that inner calls make-var (and > accesses decl) which is only being defined at expansion time. > > The error message, however, rather appears to complain about inner being > undefined rather than the definition of inner referring to undefined > entities. I am not sure what is really the problem. Either the inner function is not present at runtime due to separation of compile time and runtime, or it is a result of how defmacro re-introduces the result of the macro into the syntactic context of the macro usage (where inner is not visible). Either way, having the inner definition in the macro output will solve the problem of it not being visible.