unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Artyom Poptsov <poptsov.artyom@gmail.com>
To: guile-user@gnu.org
Subject: Re: Help to TeXmacs with Guile 2
Date: Sun, 01 Jun 2014 20:58:16 +0400	[thread overview]
Message-ID: <87fvjo1s9j.fsf@elephant.savannah> (raw)
In-Reply-To: <mailman.89.1401638430.28681.guile-user@gnu.org> (guile-user-request@gnu.org's message of "Sun, 01 Jun 2014 12:00:30 -0400")

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



       reply	other threads:[~2014-06-01 16:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.89.1401638430.28681.guile-user@gnu.org>
2014-06-01 16:58 ` Artyom Poptsov [this message]
2014-06-01  4:16 Help to TeXmacs with Guile 2 Germán Arias
2014-06-01 17:54 ` David Pirotte
2014-06-02  5:14   ` Germán Arias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvjo1s9j.fsf@elephant.savannah \
    --to=poptsov.artyom@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).