Ar an t-ochtú lá de mí na Nollaig, scríobh Julian Bradfield:
> Perhaps it should be amended to:
> Like `progn', but evaluates the body at load time in byte-compiled
> code.
It should, absolutely.
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta
Ar an t-ochtú lá de mí na Nollaig, scríobh Julian Bradfield:
> Aidan wrote:
>
> >The particular incantation you want here is:
> >
> > (eval-when-compile code to construct regexp )
> >
> >This is equivalent to a progn call when interpreted, but at compilation the
> >value the code returned is used as a byte code constant, just as a literal
> >string would be.
> >
> >A related form is #'load-time-value, which is also equivalent to #'progn
> >when interpreted, but is called once on load of a file and its return value
> >saved to avoid recalculation each time a function is called.
>
> Thanks.
>
> Is there a reason to prefer eval-when-compile to load-time-value ?
Things are a little faster for the user with eval-when-compile, there’s no
calculation at runtime or at load time.
If GNU compatibility matters to you, load-time-value is provided by the CL
package, and is thus not universally available there. (Putting
(eval-when-compile (require 'cl)) at the start of the file is endorsed by
GNU and will make #'load-time-value work, though.)
> The latter presumably works in both uncompiled and compiled code, so
> why would I use the former?
The latter is *equivalent to progn* in interpreted (= uncompiled) code, so
it doesn’t quite do what you might expect.
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta
Hi,
The combination of the `lexical-let' macro and the `labels' macro
produces the `(quote lambda)' element in its expanded form as
the case may be, and the most recent bytecomp got to fail with it.
Here is an example:
(defun test (&optional msg)
(lexical-let ((default "Hello World!"))
(labels ((fn (&optional arg)
(message "%s" (or msg default))))
(fn msg))))
It works, however it cannot be byte-compiled as follows:
(byte-compile 'test)
=> !! error (("not a lambda -- (quote lambda)"))
Whereas the version of XEmacs 21.4.22 does. The example above
is a simplified extract of the `w3m-process-do-with-temp-buffer'
macro that emacs-w3m uses; I'm unable to build and install it
for XEmacs 21.5-b31 nowadays because of such errors. You can see
the expanded form of `test' by:
(progn (pp (macroexpand
'(lexical-let ((default "Hello World!"))
(labels ((fn (&optional arg)
(message "%s" (or msg default))))
(fn msg)))
)) nil)
Regards,
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta
I realized that I don't really understand how byte compilation works.
In particular:
I have a function that involves matching against a long multi-case
regexp, which is most easily constructed rather than spelt out, but
which is constant.
So what I'm doing currently is:
(eval `(defun myfn (args)
...
,( code to construct regexp )
...
))
I have no idea how this interacts with byte-compilation.
Does it "just work"? Or do I end up with a byte-compiled file that
will have the main code of myfn uncompiled?
If it doesn't "just work", what should I be doing?
Thanks,
Julian.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta
Just in case someone else is bitten by this: I've just discovered an
unfortunate effect of the new Mercurial-based layout for the packages:
doing an "hg diff" from the packages root directory doesn't work
anymore[1]. You need to cd to the package directory before doing the
diff.
As a consequence, it's not possible anymore to define a single Patcher
project for all the packages and use the sub-project facility for
restricting the diff/commit process.
If you try it, you get an empty diff and Patcher then complains that the
sources don't differ from the archive...
Footnotes:
[1] in fact, it's worse: it just stays silent and returns nothing.
--
Resistance is futile. You will be jazzimilated.
Scientific site: http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta
Hi all,
as I was trying to get rebox2.el to work, I noticed that a lot of
functions use `^' as code letter when calling #'interactive. This is an
Emacs23 feature related to shifted motion (see below):
http://www.gnu.org/s/emacs/manual/html_node/emacs/Shift-Selection.htmlhttp://www.gnu.org/s/emacs/manual/html_node/elisp/Using-Interactive.html
Have there been any discussions as to whether it is worth porting that
behavior? For now, I suppose, filtering the code letter `^' from the
#'interactive argument string would be sufficient just to get things
going. I don't think it is possible to advice #'interactive, though. A
macro doesn't seem to work either. Any other clever idea other than
advising all interactive functions in rebox2 with new interactive
statements?
Thanks
Marcus
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta
ACTIVITY SUMMARY (2011-11-29 - 2011-12-06)
XEmacs Issue Tracking System at http://tracker.xemacs.org/XEmacs/its/
To view or respond to any of the issues listed below, click on the issue
number. Do NOT respond to this message.
541 open ( +3) / 275 closed ( +0) / 816 total ( +3)
Open issues with patches: 11
Average duration of open issues: 972 days.
Median duration of open issues: 1027 days.
Open Issues Breakdown
new 216 ( +2)
deferred 6 ( +0)
napping 4 ( +0)
verified 55 ( +0)
assigned 150 ( +0)
committed 19 ( +0)
documented 3 ( +0)
done/needs work 17 ( +0)
Issues Created Or Reopened (3)
______________________________
custom-set-face-bold does not autoload 2011-12-01
http://tracker.xemacs.org/XEmacs/its/issue816 created skm
[Bug: 21.4.22] 21.5.31 does not read my init .emacs file 2011-12-01
http://tracker.xemacs.org/XEmacs/its/issue817 created oub
malformed path in 2 examples of installing packages 2011-12-05
http://tracker.xemacs.org/XEmacs/its/issue818 created skm
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta
Hello
After having compiled and installed 21.5.31, I obtain the
following warning
Is this serious?
Uwe Brauer
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta