all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: problem with macro definitions
Date: Sat, 29 Apr 2017 11:52:22 +0200	[thread overview]
Message-ID: <874lx7r161.fsf@drachen> (raw)
In-Reply-To: <878tmjr1ry.fsf@drachen> (Michael Heerdegen's message of "Sat, 29 Apr 2017 11:39:13 +0200")

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Your macro `state-eof' actually does find the value at compile time.
> It's still an unusual use case for `defmacro' which is normally code
> transformation.  Your `state-eof' calls just expand to a number.  You
> can do this, but in real life one would probably prefer a different
> solution, like defining this number as a `defconst', depending on the
> actual use case.

BTW, a good method to do calculations at compile time is to use
`eval-when-compile'.  Depending on the actual use case, it's mostly
still good enough and easier to do such things (once) at load time.


Michael.



  reply	other threads:[~2017-04-29  9:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27 22:44 problem with macro definitions hector
2017-04-29  9:39 ` Michael Heerdegen
2017-04-29  9:52   ` Michael Heerdegen [this message]
2017-04-29 16:06   ` hector
2017-05-09  8:14     ` hector
2017-05-09 14:16       ` Michael Heerdegen

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

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

  git send-email \
    --in-reply-to=874lx7r161.fsf@drachen \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.