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 <poptsov.art...@gmail.com>
Home page: http://poptsov-artyom.narod.ru/

Reply via email to