From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: problem with macro definitions Date: Sat, 29 Apr 2017 11:52:22 +0200 Message-ID: <874lx7r161.fsf@drachen> References: <20170427224407.GA5655@workstation> <878tmjr1ry.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493459574 14433 195.159.176.226 (29 Apr 2017 09:52:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Apr 2017 09:52:54 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 29 11:52:51 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4P3a-0003ft-3P for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Apr 2017 11:52:50 +0200 Original-Received: from localhost ([::1]:40397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4P3f-0001VE-JP for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Apr 2017 05:52:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4P3C-0001V9-An for help-gnu-emacs@gnu.org; Sat, 29 Apr 2017 05:52:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d4P39-0000Zf-8r for help-gnu-emacs@gnu.org; Sat, 29 Apr 2017 05:52:26 -0400 Original-Received: from mout.web.de ([212.227.15.14]:56190) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d4P38-0000ZP-U2 for help-gnu-emacs@gnu.org; Sat, 29 Apr 2017 05:52:23 -0400 Original-Received: from drachen.dragon ([88.66.202.203]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LlFSg-1ddBu12NgE-00b4wr; Sat, 29 Apr 2017 11:52:19 +0200 In-Reply-To: <878tmjr1ry.fsf@drachen> (Michael Heerdegen's message of "Sat, 29 Apr 2017 11:39:13 +0200") X-Provags-ID: V03:K0:oj58wvIKYeU7sKDqUAFbNnATBqFUCJgH/NMlFcleOOiH2YXuOV6 Vyf1mGEcohVJUyoyT4mwmPdqcGlhl+peRxJyXgw/TePNaR/s32bdYo6M/wAtsQniJ6NEhcs mxu/pYCdJbgej/Uvj/q3rrDVC3G+uqVI1DAysjrq9CC2JfT2zzT3Jtv5QlC7tMFkmqGkDQb 5p7rmalhAovxcEXqLrIVA== X-UI-Out-Filterresults: notjunk:1;V01:K0:ZCS4H0U9gDY=:3Lgm64EIqZFlb/fNrvnFJ0 MEvsVY4FxUPpliaypmmx5sutACxgtQL/AomsGvjRIyguklVYucG8dG1pS3h4Y0XaMQZ02O58A hTy2LQgqzjwWR0bBFEtT4ZcK7ao1rtj6DkKQNEp3FIs+2IDv5Cf80zXK6IW5ru8Tol5K7xcwD 0hTeTcX7pRJ1IFiRMH00tJuQFqIkj6wYzVaEdkf3rtSLx2ADTRnuc9ttkGIS2z89MDZ+406+c vX5JGsK4/Jw/cRelXbTq7Vfyh/GIJrLocrSFsNnZacGkUancCT0uJxDTIiWbXCCypq9oxcZi0 7VcmCRRqDy7uFBlD9q3Qaj11xYZDP5gn6x/mvEGa/aLU1B6WhiSD5UmJuSkfhqgtd2zvqtvLO zXyoSeIRUFb+8Ko+C/xQChVGumHkcg9vBXxlIIEqSAVWTlsAB2Z6/1+fYBjd0QVuSlgaxD9sv XC6zFnJTQ2v+w6Re5Dz99PWlCbB5uSKndrwgmAis5FVPelDN9O8HQwPRyCGrGbSkBTkwC4xz2 KaS/y3TlIJXx/ykmYzFwFyYJSb/flabo7gWrKCA/8/RoDRUyO085SXDWFao1Pquew4lhjog1z pFIPmszAJiz/vsZWZeh/mbDUzrSRfr4UCWoZI/l7Pog9FZxs364XmBTtntiC5tc82lV3ZZ3OY dUZ5G6sk3HCXQM/Cbl8rV7UUKAtKjJc1ByET6KnOXYo+0tE6MqZ3F8PlyNCVnDLE0N9h6ua2f TJK8aTmuj1knp1gopnghR0Pzp019VvUcRjksYgVP/+bQO0RxEwO/6rgETDAzXBG0cjdsJpME X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112899 Archived-At: Michael Heerdegen 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.