From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artyom Poptsov Newsgroups: gmane.lisp.guile.user Subject: Re: Help to TeXmacs with Guile 2 Date: Sun, 01 Jun 2014 20:58:16 +0400 Message-ID: <87fvjo1s9j.fsf@elephant.savannah> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1401641902 2693 80.91.229.3 (1 Jun 2014 16:58:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Jun 2014 16:58:22 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jun 01 18:58:18 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wr95M-0005UK-C1 for guile-user@m.gmane.org; Sun, 01 Jun 2014 18:58:16 +0200 Original-Received: from localhost ([::1]:41461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr95M-000715-2x for guile-user@m.gmane.org; Sun, 01 Jun 2014 12:58:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr958-0006ru-JV for guile-user@gnu.org; Sun, 01 Jun 2014 12:58:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wr953-0007l9-Ko for guile-user@gnu.org; Sun, 01 Jun 2014 12:58:02 -0400 Original-Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:34624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr953-0007kW-Cu for guile-user@gnu.org; Sun, 01 Jun 2014 12:57:57 -0400 Original-Received: by mail-la0-f53.google.com with SMTP id ty20so2017363lab.26 for ; Sun, 01 Jun 2014 09:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=Jik9/E1y/RveXqtFFwzVn+Qwn0yB7AP4RPZd/yVHYRY=; b=PHRZk7/MX/Vjm6EU0wdcP+2P4sYctNmuTNkAHGDZOUYbQ3V8iPE+WnmI6dJHLZqt8r XADfxjDCGQyUhRU+6H+WcG9PMsPjRb8aL77/iRZsvUjqEhdlMHJlM1GYPQTL3YmLuwB5 Cz/5JqH+BncvDeKQawffKPgVJ4FwzoFpplkUBKgZLO3FuymjdeRbr8bgydbP8W7szAOp UOjA6O1y/bYaA1ASVPqsiN6khpzYq+iq04+Otz8ZHOVB82MFcD9A9R7Puv5B9IgF1FPK 6G1lRrausRwXsLYtoz5uP/jna/4//BivgKCg6mMPK46Va6FnfMiA+S509VvZuKNC1nrp 4uOQ== X-Received: by 10.112.146.202 with SMTP id te10mr2321070lbb.75.1401641875746; Sun, 01 Jun 2014 09:57:55 -0700 (PDT) Original-Received: from elephant.savannah (109-184-178-39.dynamic.mts-nn.ru. [109.184.178.39]) by mx.google.com with ESMTPSA id k9sm8932838lam.11.2014.06.01.09.57.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 01 Jun 2014 09:57:54 -0700 (PDT) In-Reply-To: (guile-user-request@gnu.org's message of "Sun, 01 Jun 2014 12:00:30 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::235 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11281 Archived-At: Hi German, > I don't have experience with macros. But I get this error trying > TeXmacs with Guile 2.x: I think the problem is that you trying to define a macro in a context in which definitions are not allowed. Here what the Guile docs says: "A =E2=80=98define-syntax=E2=80=99 form is valid anywhere a definition may = appear: at the top-level, or locally." [1] "A =E2=80=98define=E2=80=99 form which appears inside the body of a =E2=80= =98lambda=E2=80=99, =E2=80=98let=E2=80=99, =E2=80=98let*=E2=80=99, =E2=80=98letrec=E2=80=99, =E2=80=98letrec*=E2=80=99= or equivalent expression is called an "internal definition". [..] Internal definitions are only allowed at the beginning of the body of an enclosing expression. They may not be mixed with other expressions." [2] It means that you should define the macro either in the top level context (outside any define's, let's etc) or at the beginning of a local binding contruct like `let', `letrec' etc. I hope this helps. Thanks, - Artyom [1] https://www.gnu.org/software/guile/manual/html_node/Defining-Macros.htm= l#Defining-Macros [2] https://www.gnu.org/software/guile/manual/html_node/Internal-Definition= s.html#Internal-Definitions --=20 Artyom V. Poptsov Home page: http://poptsov-artyom.narod.ru/