* cl
@ 1999-12-14 4:21 Katsumi Yamaoka
1999-12-14 11:01 ` cl Hrvoje Niksic
0 siblings, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 1999-12-14 4:21 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
This is the patch for eliminating run-time cl.
1999-12-14 04:14:44 Katsumi Yamaoka <yamaoka@jpl.org>
* dgnushack.el (last, mapcon, member-if, union): New compiler
macros for emulating cl functions.
[-- Attachment #2: dgnushack.el.diff --]
[-- Type: application/x-patch, Size: 2015 bytes --]
[-- Attachment #3: Type: text/plain, Size: 365 bytes --]
It has been done in T-gnus 6.14. If you are interested in it, please
checkout it from the chamonix open CVS server as follows.
% cvs -d :pserver:anonymous@chamonix.jaist.ac.jp:/hare/cvs/root login
CVS password: [CR] # NULL string
% cvs -d :pserver:anonymous@chamonix.jaist.ac.jp:/hare/cvs/root checkout\
-r t-gnus-6_14 gnus
--
Katsumi Yamaoka <yamaoka@jpl.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: cl
1999-12-14 4:21 cl Katsumi Yamaoka
@ 1999-12-14 11:01 ` Hrvoje Niksic
1999-12-14 11:37 ` cl Katsumi Yamaoka
0 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1999-12-14 11:01 UTC (permalink / raw)
Katsumi Yamaoka <yamaoka@jpl.org> writes:
> This is the patch for eliminating run-time cl.
>
> 1999-12-14 04:14:44 Katsumi Yamaoka <yamaoka@jpl.org>
>
> * dgnushack.el (last, mapcon, member-if, union): New compiler
> macros for emulating cl functions.
Could you please code these things so that they are not called under
XEmacs, where cl.el is "official"?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: cl
1999-12-14 11:01 ` cl Hrvoje Niksic
@ 1999-12-14 11:37 ` Katsumi Yamaoka
1999-12-14 18:55 ` cl Jan Vroonhof
0 siblings, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 1999-12-14 11:37 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 499 bytes --]
>>>>> In <9t9ln6xrdkt.fsf@mraz.iskon.hr>
>>>>> Hrvoje Niksic <hniksic@iskon.hr> wrote:
>> This is the patch for eliminating run-time cl.
>>
>> 1999-12-14 04:14:44 Katsumi Yamaoka <yamaoka@jpl.org>
>>
>> * dgnushack.el (last, mapcon, member-if, union): New compiler
>> macros for emulating cl functions.
Hrvoje> Could you please code these things so that they are not called
Hrvoje> under XEmacs, where cl.el is "official"?
Okay, thanks for the advice. This is a replacement of the patch.
[-- Attachment #2: dgnushack.el.diff --]
[-- Type: application/x-patch, Size: 2143 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: cl
1999-12-14 11:37 ` cl Katsumi Yamaoka
@ 1999-12-14 18:55 ` Jan Vroonhof
1999-12-14 22:43 ` cl Katsumi Yamaoka
0 siblings, 1 reply; 10+ messages in thread
From: Jan Vroonhof @ 1999-12-14 18:55 UTC (permalink / raw)
Katsumi Yamaoka <yamaoka@jpl.org> writes:
> Hrvoje> Could you please code these things so that they are not called
> Hrvoje> under XEmacs, where cl.el is "official"?
>
> Okay, thanks for the advice. This is a replacement of the patch.
>
>
> --- dgnushack.el~ Mon Dec 6 02:04:45 1999
> +++ dgnushack.el Tue Dec 14 11:34:55 1999
> @@ -30,6 +30,83 @@
>
> (require 'cl)
>
> +(define-compiler-macro last (&whole form x &optional n)
> + (if (or (featurep 'xemacs)
> + (and (fboundp 'last)
Why not wrap the whole thing an
(unless (featurep 'xemacs) ..)
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: cl
1999-12-14 18:55 ` cl Jan Vroonhof
@ 1999-12-14 22:43 ` Katsumi Yamaoka
0 siblings, 0 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 1999-12-14 22:43 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 329 bytes --]
>>>>> In <byd7s9uzc0.fsf@bolzano.math.ethz.ch>
>>>>> Jan Vroonhof <vroonhof@math.ethz.ch> wrote:
>> +(define-compiler-macro last (&whole form x &optional n)
>> + (if (or (featurep 'xemacs)
>> + (and (fboundp 'last)
Jan> Why not wrap the whole thing an
Jan> (unless (featurep 'xemacs) ..)
This is the third time lucky. :-)
[-- Attachment #2: dgnushack.el.diff --]
[-- Type: application/x-patch, Size: 2060 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: cl
1999-01-28 7:37 ` cl Lars Magne Ingebrigtsen
@ 1999-01-28 18:16 ` Hrvoje Niksic
0 siblings, 0 replies; 10+ messages in thread
From: Hrvoje Niksic @ 1999-01-28 18:16 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Now, `mapcar' isn't a special form, but even so, I always forget
> whether the predicate is the first or second parameter, due in part
> to `sort' working the opposite way.
>
> (mapcar FUNCTION LIST)
In Common Lisp it's:
(mapcar FUNCTION LIST &rest OTHER-LISTS)
If you specify more than one list, FUNCTION will be called with that
many arguments. In Emacs, the CL version of `mapcar' is called
`mapcar*'.
BW, this fact is a good way of remembering that FUNCTION comes first,
and why.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: cl
1999-01-27 21:01 ` cl Justin Sheehy
@ 1999-01-28 7:37 ` Lars Magne Ingebrigtsen
1999-01-28 18:16 ` cl Hrvoje Niksic
0 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-01-28 7:37 UTC (permalink / raw)
Justin Sheehy <justin@linus.mitre.org> writes:
> What's wrong with the current mapc syntax? Is there something that
> you would like other than to have the parameter order reversed?
No, but I think that's a good reason. Virtually all the Lisp "control
structures" look like
(special-form variables-or-list-or-something
(do-all-the-work-down-here))
Now, `mapcar' isn't a special form, but even so, I always forget whether
the predicate is the first or second parameter, due in part to `sort'
working the opposite way.
(mapcar FUNCTION LIST)
vs.
(sort LIST PREDICATE)
(Heh. I actually wrote the `sort' form with the parameters in the
wrong order, but then I tapped `C-h f', as I always do when I write
`sort' or `mapcar', and it told me I was wrong, as usual. :-)
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: cl
1999-01-27 19:10 ` cl Jan Vroonhof
@ 1999-01-27 21:01 ` Justin Sheehy
1999-01-28 7:37 ` cl Lars Magne Ingebrigtsen
0 siblings, 1 reply; 10+ messages in thread
From: Justin Sheehy @ 1999-01-27 21:01 UTC (permalink / raw)
Jan Vroonhof <vroonhof@math.ethz.ch> writes:
> Wouldn't it have been much nicer if the map syntax had been
>
> (mapc list func) so you could just write the nice and pure
>
> (mapc some-thing
> (lambda (var)
> ....))
What's wrong with the current mapc syntax? Is there something that
you would like other than to have the parameter order reversed?
-Justin, confused
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: cl
1999-01-27 17:03 cl Lars Magne Ingebrigtsen
@ 1999-01-27 19:10 ` Jan Vroonhof
1999-01-27 21:01 ` cl Justin Sheehy
0 siblings, 1 reply; 10+ messages in thread
From: Jan Vroonhof @ 1999-01-27 19:10 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
>
> (dolist (var (some-thing))
> ...)
Wouldn't it have been much nicer if the map syntax had been
(mapc list func) so you could just write the nice and pure
(mapc some-thing
(lambda (var)
....))
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread
* cl
@ 1999-01-27 17:03 Lars Magne Ingebrigtsen
1999-01-27 19:10 ` cl Jan Vroonhof
0 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-01-27 17:03 UTC (permalink / raw)
Gowrsh. I really should re-read CLtL2.
(let ((vars (some-ting))
var)
(while (setq var (pop vars))
...))
which I usually write, vs
(dolist (var (some-thing))
...)
And the latter is even a macro in cl-macs that expands to nice
Emacs-lisp bytecodes.
(And the first form even assumes that there are no non-nil elements in
the list. Which is true everywhere I use it, but that makes the
dolist thing even more elegant.)
--
(domestic pets only, the antidote for overdose, milk.)
larsi@ifi.uio.no * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~1999-12-14 22:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-14 4:21 cl Katsumi Yamaoka
1999-12-14 11:01 ` cl Hrvoje Niksic
1999-12-14 11:37 ` cl Katsumi Yamaoka
1999-12-14 18:55 ` cl Jan Vroonhof
1999-12-14 22:43 ` cl Katsumi Yamaoka
-- strict thread matches above, loose matches on Subject: below --
1999-01-27 17:03 cl Lars Magne Ingebrigtsen
1999-01-27 19:10 ` cl Jan Vroonhof
1999-01-27 21:01 ` cl Justin Sheehy
1999-01-28 7:37 ` cl Lars Magne Ingebrigtsen
1999-01-28 18:16 ` cl Hrvoje Niksic
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 NNTP newsgroup(s).