From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Han-Wen Nienhuys Newsgroups: gmane.lisp.guile.devel Subject: Re: unhandled constant? Date: Thu, 30 Jan 2020 09:05:17 +0100 Message-ID: References: <87r1ziti8g.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="42823"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org To: Ricardo Wurmus Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Jan 30 09:05:47 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 1ix4pe-000B5n-Mw for guile-devel@m.gmane-mx.org; Thu, 30 Jan 2020 09:05:46 +0100 Original-Received: from localhost ([::1]:57020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ix4pd-0003tR-Nt for guile-devel@m.gmane-mx.org; Thu, 30 Jan 2020 03:05:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51568) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ix4pP-0003px-Sd for guile-devel@gnu.org; Thu, 30 Jan 2020 03:05:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ix4pO-0002vo-Ot for guile-devel@gnu.org; Thu, 30 Jan 2020 03:05:31 -0500 Original-Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]:36050) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ix4pO-0002t1-Hb for guile-devel@gnu.org; Thu, 30 Jan 2020 03:05:30 -0500 Original-Received: by mail-oi1-x232.google.com with SMTP id c16so2668620oic.3 for ; Thu, 30 Jan 2020 00:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=45iixJTGAFfCK+q0yxI0DNW/RXWM4PXXxkQx7SOQZEY=; b=VFq/kVQRMwKVlPLGfhdKGEeflFb0IH7ZceQpBfrsgZon3y8phvIRQLcP1Gi+pV9A5O 79jXrFKfkfnQm4Wil9ypTH30oAENxPL3SK/X6pwrNAgtMJa5frjdkxERfqg1w/bNMceV 67FFiFwOHChVAsC3w9hPYNh5Z+H7SUfc7zIriszBm1pH8yw9GYHdal694lUfFKZpmwqg f/A5E+OXxD9QtDitg8mGwq7QaCQv+tFAnrD1xBpurtpQyAgNMzO2IqQaL+TTpYX3qbNK GWwiiqOfo4Ljpa8YuPIA8G6zexB1nLxnTH8lK+rNIwtY+bGf9hbLa0ijx8iQU8ePTksr nxuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=45iixJTGAFfCK+q0yxI0DNW/RXWM4PXXxkQx7SOQZEY=; b=h0zuVkC+cjn4LbcmpxwSM5RoBctlwszkE1jeAB8LEXGaXOBGbuO+6jm7wghagMFds8 CjwRb7CvSkDEB3kOsBVUsViHKrgVy5vGTJrcZ+l8yMrHAbDL4l8A0Z6vPPWUlS09Z9rX sJjoLIr57NV8HSKjZucoQuNUHG0R9VtLipLDWJFFz6AGtp2aDK84YMWPcoKwzBeVDQgb gFQxL5wozhkrZFN0JA6Eo6Fxr1rLp7NrkcoqU5fPmycyncXHS1Of0P8JcehauSV+iySQ +9Lh1DFYNFvfT+XlTIHlqNr+9TNEP7wTGjhhjkhI1LfgxcsgipYilQpo9i6nEOz+LOyk 4QAg== X-Gm-Message-State: APjAAAVnYfxz14OVHU0muLMfksk8pY0zfSut/KWi0kyXpL3UNvXJzhVq Xz/k5TvDJQS6n6HYQ5I9qMxdimm+S6CMpMPAaRboqMkPs/g= X-Google-Smtp-Source: APXvYqw/Z1JwedelWUlOfy15ykUB6a3EHxLcNj3WkPQfUqy9p+ejYszEpOspLg+qbFTfoFTSJGtSHeeE+KNpR4wGnNU= X-Received: by 2002:aca:5258:: with SMTP id g85mr2196156oib.80.1580371528675; Thu, 30 Jan 2020 00:05:28 -0800 (PST) In-Reply-To: <87r1ziti8g.fsf@elephly.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::232 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:20353 Archived-At: [guile1.8]$ grep -ir define-syntax-rule . (empty) I need something that works in GUILE 1.8 too. this is what I got from David Kastrup: >Got any comments about macros being sooo yesterday compared to syntax forms? Syntax forms actually don't work in LilyPond: there was an incompatibility because the 1.8 implementation will balk if some symbol used in syntax forms already has a definition, and we have that. I forgot the exact symbol at fault. I think it was some music function name. Would there be a way that we can use our source code unchanged with GUILE 2.2? Can you explain why I get this error message? On Wed, Jan 29, 2020 at 4:06 PM Ricardo Wurmus wrote: > > > Han-Wen Nienhuys writes: > > > Some of the lilypond Scheme files do the following: > > > > > > (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) > > > > In GUILE 2.2, this yields > > > > ;;; WARNING: compilation of /home/hanwen/vc/lilypond/q.scm failed: > > ;;; unhandled constant # > > > > What does this error message mean, and what should I do to address the problem? > > Would it be feasible to use define-syntax-rule here? > > --8<---------------cut here---------------start------------->8--- > (define decl '()) > (define (make-var n v) (list "var" n v)) > (define-syntax-rule (define-session name value) > (let ((inner (lambda (n v) > (set! decl > (cons > (make-var n v) > decl))))) > (inner 'name value))) > (define-session foo 1) > (display decl) > (newline) > --8<---------------cut here---------------end--------------->8--- > > > -- > Ricardo -- Han-Wen Nienhuys - hanwenn@gmail.com - http://www.xs4all.nl/~hanwen