[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help to TeXmacs with Guile 2
From: |
Artyom Poptsov |
Subject: |
Re: Help to TeXmacs with Guile 2 |
Date: |
Sun, 01 Jun 2014 20:58:16 +0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
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 ‘define-syntax’ form is valid anywhere a definition may appear: at
the top-level, or locally." [1]
"A ‘define’ form which appears inside the body of a ‘lambda’, ‘let’,
‘let*’, ‘letrec’, ‘letrec*’ 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.html#Defining-Macros
[2]
https://www.gnu.org/software/guile/manual/html_node/Internal-Definitions.html#Internal-Definitions
--
Artyom V. Poptsov <address@hidden>
Home page: http://poptsov-artyom.narod.ru/