[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: request for a new function, say, `sequence'
From: |
Kenichi Handa |
Subject: |
Re: request for a new function, say, `sequence' |
Date: |
Wed, 26 Mar 2003 08:11:37 +0900 (JST) |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) |
In article <address@hidden>, "Stefan Monnier" <monnier+gnu/address@hidden>
writes:
>> (defun dev-charseq (from &optional to)
>> (if (null to) (setq to from))
>> (mapcar (function (lambda (x) (indian-glyph-char x 'devanagari)))
>> (devanagari-range from to)))
> But in this example as well a variant of `dotimes' would work just as well
> and would avoid the unnecessary consing.
Modify the resulting list of devanagari-range destructively
will also avoid the unnecessary consing.
> Emacs is not very good at efficiently consing+GCing, so
> it's good to avoid such things when it can be done without
> impacting the readbility (Emacs-21 is dog slow on my
> 266Mhz machine).
Yes, I know. But the main reason for my proposal is for
readability. Currently, the above function is used mainly
for defining a data in defvar, so the speed is not that
important. On the other hand, XXX-util.el (especially the
data definition parts) must be read and modified by native
XXX users who may not be familiar with lisp. So, it's very
important to provide easy-to-understand data definition
parts.
> Also, all the examples I've seen use lists. Given my background in
> type-systems, I must say that I don't like functions that returns either
> a list or a vector or a string depending on some extra arg. If we
> want a function for convenience (rather than performance), then
> returning a list is good enough. You can always pass the result
> to `string' or to `vector' if you want something else.
As far as I see the current usage, a function returning a
list is enough. So, I don't insist on having TYPE argument.
> Anyway, blue is the color for my bykeshed, what is yours ?
What is "bykeshed"? My dictionary doesn't have that word.
> will show you that CL is used all over the place, including in files that
> are pre-loaded (though fewer of them, admittedly). As long as CL is only
> needed when byte-compiling the file, it's OK (i.e. if it's wrapped in
> `eval-when-compile'). At least that was RMS' official position last time
> this was brought up.
Thank you for clarifying that. Ok, I'll use
(eval-when-compile (require 'cl)
in a place that is appropriate.
---
Ken'ichi HANDA
address@hidden
- Re: request for a new function, say, `sequence', (continued)
- Re: request for a new function, say, `sequence', Kenichi Handa, 2003/03/25
- Re: request for a new function, say, `sequence', Satyaki Das, 2003/03/25
- Re: request for a new function, say, `sequence', Kenichi Handa, 2003/03/25
- Re: request for a new function, say, `sequence', Satyaki Das, 2003/03/25
- Re: request for a new function, say, `sequence', Luc Teirlinck, 2003/03/25
- Re: request for a new function, say, `sequence', Edward O'Connor, 2003/03/26
- Re: request for a new function, say, `sequence', Thien-Thi Nguyen, 2003/03/26
- Re: request for a new function, say, `sequence', Kenichi Handa, 2003/03/26
- Re: request for a new function, say, `sequence', Richard Stallman, 2003/03/26
- Re: request for a new function, say, `sequence', Stefan Monnier, 2003/03/25
- Re: request for a new function, say, `sequence',
Kenichi Handa <=
- Re: request for a new function, say, `sequence', Miles Bader, 2003/03/25
- Re: request for a new function, say, `sequence', Luc Teirlinck, 2003/03/25
- Re: request for a new function, say, `sequence', Miles Bader, 2003/03/25
- Re: request for a new function, say, `sequence', Kenichi Handa, 2003/03/25
- Re: request for a new function, say, `sequence', Miles Bader, 2003/03/25
- Re: request for a new function, say, `sequence', Stefan Monnier, 2003/03/26
- Re: request for a new function, say, `sequence', Luc Teirlinck, 2003/03/26
- Re: request for a new function, say, `sequence', Stefan Monnier, 2003/03/27
- Re: request for a new function, say, `sequence', Luc Teirlinck, 2003/03/27
- Re: request for a new function, say, `sequence', Stefan Monnier, 2003/03/27