[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't compile

From: Kevin Rodgers
Subject: Re: Can't compile
Date: Tue, 27 Feb 2007 20:16:37 -0700
User-agent: Thunderbird (Macintosh/20061207)

Robert Thorpe wrote:
On Feb 24, 10:28 am, Xavier Maillard <address@hidden> wrote:

I am trying to byte-compile nero.el[1] but it just fails with
this error:

In nero-restore-match:
nero.el:1526:17:Warning: `string-to-int' is an obsolete function (as of Emacs
    22.1); use `string-to-number' instead.
nero.el:2119:1:Error: Symbol's function definition is void: nero-follow-numbers
make: *** [nero.elc] Error 1

The first warning is easy to fix (and I fixed it) but what about
the second error ?

I don't know anything about this code, but what is shown here is a
rather common lisp error.

The function nero-follow-numbers is used in a macro.  This macro is
used in the file/compilation block nero.elc.
The bytecompiler works on a per file basis.  It compiles each of the
defuns to bytecodes completing it's actions once the file is
finished.  Macros though must be expanded when the code is being read,
at this stage the defuns in the file have not yet been finalised.

This works fine for the normal evalutator because it finalises and
installs a function at the end of the defun form.

This is why "eval-and-compile" is needed.

A cleaner design would be for the macro to return a form that contains a
call to the function, rather calling the function during macro expansion
to generate the returned form.

Kevin Rodgers
Denver, Colorado, USA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]