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: Fri, 31 Jan 2020 15:57:41 +0100 Message-ID: <8d77f905-31e9-4d0b-973a-82be38360e07@www.fastmail.com> References: Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="130739"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.1.7-781-gfc16016-fmstable-20200127v1 To: "Han-Wen Nienhuys" , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Fri Jan 31 15:58:25 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 1ixXkW-000Xxh-3X for guile-devel@m.gmane-mx.org; Fri, 31 Jan 2020 15:58:24 +0100 Original-Received: from localhost ([::1]:54134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixXkV-000748-5q for guile-devel@m.gmane-mx.org; Fri, 31 Jan 2020 09:58:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32772) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixXkF-00070h-Fr for guile-devel@gnu.org; Fri, 31 Jan 2020 09:58:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixXkD-00082o-BS for guile-devel@gnu.org; Fri, 31 Jan 2020 09:58:07 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37811) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ixXkD-0007yF-21 for guile-devel@gnu.org; Fri, 31 Jan 2020 09:58:05 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 2809E21236; Fri, 31 Jan 2020 09:58:03 -0500 (EST) Original-Received: from imap1 ([10.202.2.51]) by compute3.internal (MEProxy); Fri, 31 Jan 2020 09:58:03 -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 :subject:content-type:content-transfer-encoding; s=fm1; bh=PCicD 25PPyWWZVS3Jz7PZbdzs7Tjqv749JtAFQ2g4/8=; b=MZikpbPgYL5qr2JsMDNW1 suyjfEPXAzn7u0AD0mst6sC7DqgHUjP5QedrHPfOZdfbIpr0MYpma0ZySCBXD3KZ QTgU1p7FyIV6zmg6r3ax9Tm57nQnNL+uQnl/FRfIPL7S7w0Nl9ULbZamgjB5CS77 LW0YX1/xQT6UE7MP6QjUMIn4Vty+bpL24lFJG+ru3B0sVRy1weONEvr+gyw6NEKW m0zMP8DkKGPTtpmZXWrSuogX8hggYrskVkYSUSy3kWt07xd4X4ESqbLGAG1bpZgR oVm6Wdxsy+0VZ8RxfQ315pESZb/ZbogARt+V6RGI7AANFFm3xCK2+g6qnxNxbt8d Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding: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=PCicD25PPyWWZVS3Jz7PZbdzs7Tjqv749JtAFQ2g4 /8=; b=duO1Vkrd1NqrszGvi5wQWlK22N0udT7YJQAbhVukbQ2OA3VrJO5vXrIlA p3Fx7vCbU1ly2lA70X1JU2duaQpwbu9Q/XoVngmrV0c7p3hgIS8N9oF0VEIgmgxv c54RDpMLPgIBenO9UyZr5fcx/7Xx1eWdOd72yqp3skVR5PQH3O9pbpFSgdSUDJ12 c9vtyemMwx7PWVjV0VsK/uFwj1z4HwN6txAhZ9qcbHipcATj58xTq5JaEqM2As1c 0CLKbMAySdxFY4XNIdOmC/hpoD7OAH4cTLso8QtUIWK29clQSQ4WGirmDmo4jl+Z UM4u0Ay4V5VzWfyBYnLJQGqNW6yBg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrgedtgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgfgsehtqh ertderreejnecuhfhrohhmpefnihhnuhhspgeujhpnrhhnshhtrghmuceolhhinhhushdr sghjohhrnhhsthgrmhesvhgvrhihfhgrshhtrdgsihiiqeenucffohhmrghinhepgihsge grlhhlrdhnlhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghrhihfrghsthdrsghiii X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id DA561C200A4; Fri, 31 Jan 2020 09:58:02 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 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:20357 Archived-At: Guile1.8's macros are run-time macros: they are executed directly and no= t transformed to output code that is then compiled. That is the reason w= hy your code works: to newer guiles the (inner ...) is only available at= expansion time. The macro output is trying to call code that does not e= xist at runtime! For this to be working code the (inner ...) function needs to be availab= le in the macro expansion. I didn't read through exactly what you are tr= ying to do, but try outputting a let: `(let ((inner (lambda (n v) (set ! ...)))) (inner ,name ,value)) I doubt you can make the old code work in newer guiles, since I doubt an= y scheme is a s lax about expansion time and macro time separation. --=20 Linus Bj=C3=B6rnstam On Wed, 29 Jan 2020, at 00:08, Han-Wen Nienhuys wrote: > Some of the lilypond Scheme files do the following: >=20 >=20 > (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) >=20 > In GUILE 2.2, this yields >=20 > ;;; WARNING: compilation of /home/hanwen/vc/lilypond/q.scm failed: > ;;; unhandled constant # >=20 > What does this error message mean, and what should I do to address the= problem? > --=20 > Han-Wen Nienhuys - hanwenn@gmail.com - http://www.xs4all.nl/~hanwen >=20 >