all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: MON KEY <monkey@sandpframing.com>
To: emacs-devel@gnu.org
Subject: moving more cl seq/mapping support into core
Date: Fri, 24 Sep 2010 18:48:26 -0400	[thread overview]
Message-ID: <AANLkTikU7-2xj-uS87ENkEn=OgKGRM8F8+AP2f360XrX@mail.gmail.com> (raw)

,----
| :FROM:                      Chong Yidong
| :SUBJECT:                   Re: Problems with xml-parse-string
| :DATE:                      Fri, 24 Sep 2010 12:26:21 -0400
|
| It is illogical to criticize sxml for wasting conses, while arguing for
| wrapping each text node in a cons.
|
| Anyway, it is difficult to see how real the problem is without a
| concrete example.  Could you provide one?  I suspect that the real
| problem, if one exists, is Elisp's relatively weak support for list
| mapping and reduction; if that's the case, the correct solution is to
| pull in some of the relevant functions from the CL package.
|
| (URL `http://lists.gnu.org/archive/html/emacs-devel/2010-09/msg01250.html')
`----

,----
|
| :FROM    RMS
| :SUBJECT Re: Emacs Package Management
| :DATE    Tue, 15 Sep 2009 03:16:50 -0400
|
|
|     Could we then privide aliases like "cl-loop" for "loop" ?
|
| I am not against it.
|
|     Maybe we could include Cl functions in the Emacs core
|     incrementaly then?  Each CL function moved to the core would
|     require an agreement on the functions inclusion and a
|     documentation patch.
|
| That's more or less what we've been doing.  Originally I strove very
| hard to keep Emacs itself small.  Many basic and obviously useful
| functions were not standardly available, but they were in CL. Since
| then we have made a number of them standard, and we could certainly
| do this for more of them in the future when it seems best.
|
| But some of the CL facilities are overly complex.  And some,
| specifically setf and friends, are not implemented quite right in
| the Emacs context, which makes them ugly to include.
|
| {...}
|
| :SEE (URL `http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00342.html')
`----


Following is a list of symbols in other packages wich cl.el provides and which
are duplicated either verbatim or indirectly to achieve the same affect
and presumably to avoid cl.el runtime package requirements.
These are without the `&keys` lambda-lists but some provide predicate
type arguments to accomplish similiarly to :test

`edmacro-subseq'            <- `subseq' emacs-lisp/cl-extra.el
`smtpmail-intersection'     <- `intersection' emacs-lisp/cl-seq.el
`dired-file-set-difference' <- `set-difference'  lisp/dired-aux.el

`edebug-gensym-index' <- `*gensym-counter*' emacs-lisp/cl-macs.el
`edebug-gensym'       <- `gensym'  emacs-lisp/cl-macs.el

`edebug-lambda-list-keywordp' could be improved by changing from:

  (and (symbolp object)
       (= ?& (aref (symbol-name object) 0)))

to:
 (and (memq object lambda-list-keywords) t)

e.g.
 (and (memq '&aux lambda-list-keywords) t)

`lambda-list-keywords' is a constant in emacs-lisp/cl-macs.el

erc/erc-compat.el
`erc-member-if', `erc-delete-if', `erc-remove-if-not'
`erc-subseq' is a verbatim duplicate of `subseq'.

gnus-util.el has `gnus-merge' which is a modified version of cl.el's `merge'
It does a noop for its TYPE arg (but includes it for compatibility) and omits
the "&rest cl-keys" from its lambda-list.

It also provides a function `gnus-mapcar' which is a variant of `mapcar*'
without `cl-mapcar-many' dependence.

`gnus-remove-if' is similar to `remove-if' without CL keywords.

Are there any others like this that I've missed?

Following is a list of cl.el derived feautres which don't appear (as best I can
tell) to rely on cl keywords. I've attempted to enumerate where a given symbol
carries a `cl-compiler-macro` property or `cl-byte-compile-compiler-macro` and
`byte-compile-inline-expand` property values.

Surely some of these are good canditdates for moving into core.  They're
certainly tested, documented and some of them are significantly optimized away
by the byte-compiler.

;; artithmetic
`gcd'            ;(symbol-plist 'gcd)
                 ;=> side-effect-free t

`lcm'            ;(symbol-plist 'lcm)
                 ;=> side-effect-free t

`isqrt'          ;(symbol-plist 'isqrt)
                 ;=> side-effect-free t

`signum'         ;(symbol-plist 'signum)
                 ;=> side-effect-free t

`equalp'         ;(symbol-plist 'equalp)
                 ;=> side-effect-free error-free

`plusp'  ;(symbol-plist 'plusp)
         ;=> side-effect-free t
         ;   byte-compile cl-byte-compile-compiler-macro
         ;   cl-compiler-macro (lambda (w x) (list (quote >) x 0))

`minusp' ;(symbol-plist 'minusp)
         ;=> side-effect-free t byte-compile
         ;    cl-byte-compile-compiler-macro
         ;    cl-compiler-macro (lambda (w x) (list (quote <) x 0)))

`oddp'   ;(symbol-plist 'oddp)
         ;=> side-effect-free t

`evenp'  ;(symbol-plist 'evenp)
         ;=> side-effect-free t

;; generalized
`cl-set-frame-visible-p'

;; type
`coerce'

;; matching
`every'
`some'
`notevery'  ;(symbol-plist 'notevery)
            ;=> byte-optimizer byte-compile-inline-expand

`notany'    ;(symbol-plist 'notany)
            ;=> byte-optimizer byte-compile-inline-expand

;; mapping
`map'       ;(symbol-plist 'map)
            ;=> byte-optimizer byte-compile-inline-expand
`mapcon'
`mapl'
`cl-mapc'
`maplist'
`cl-mapcar-many'
`cl-map-keymap-recursively'
`cl-map-intervals'
`cl-map-overlays'

;; seqs
`concatenate' ;(symbol-plist 'concatenate)
              ;=> byte-optimizer byte-compile-inline-expand

`revappend'   ;(symbol-plist 'revappend)
              ;=> byte-optimizer byte-compile-inline-expand

`nreconc'     ;(symbol-plist 'nreconc)
              ;=> byte-optimizer byte-compile-inline-expand

`list-length' ;(symbol-plist 'list-length)
              ;=> side-effect-free t

`endp'       ;(symbol-plist 'endp);
             ;=> side-effect-free t
             ;   byte-compile cl-byte-compile-compiler-macro
             ;   cl-compiler-macro (lambda (w x) (list (quote null) x)))


`acons'  ; (symbol-plist 'acons)
         ;=> side-effect-free error-free
         ;   byte-optimizer byte-compile-inline-expand

`list*'  ;(symbol-plist 'list*)
         ;=> side-effect-free error-free
         ;   byte-compile cl-byte-compile-compiler-macro
         ;   compiler-macro-file "cl-macs.el"
         ;   cl-compiler-macro #[ ...byte-code-vector elided ]

`ldiff'    ;(symbol-plist 'ldiff)
           ;=> side-effect-free t

`pairlis'  ;(symbol-plist 'pairlis)
           ;=> side-effect-free t

;; These don't have `cl-' namespacing for symbol-name or the local vars.
`copy-list'
`tailp'

;; This one doesn't have `cl-' namespacing for the local vars.
`cl-maclisp-member'

--
/s_P\



             reply	other threads:[~2010-09-24 22:48 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 22:48 MON KEY [this message]
2010-09-25  5:13 ` moving more cl seq/mapping support into core Leo
2010-09-25  5:58   ` Miles Bader
2010-09-25 14:42     ` Drew Adams
2010-09-25 15:07       ` Leo
2010-09-25 15:23         ` Drew Adams
2010-09-25 15:30           ` Leo
2010-09-25 15:33             ` David Kastrup
2010-09-25 15:55               ` Drew Adams
2010-09-25 15:55             ` Drew Adams
2010-09-25 16:01               ` Leo
2010-10-01  0:33             ` Daniel Colascione
2010-09-25 21:26       ` Miles Bader
2010-09-26 10:37   ` Richard Stallman
2010-09-26 13:13     ` Leo
2010-09-26 19:32       ` Miles Bader
2010-09-27  6:27       ` Richard Stallman
2010-10-01  0:28         ` Daniel Colascione
2010-10-01  3:16           ` Miles Bader
2010-10-01 20:39             ` Daniel Colascione
2010-10-02  7:12               ` David Kastrup
2010-10-03 23:15                 ` Stefan Monnier
2010-10-04 17:41                   ` Daniel Colascione
2010-10-05 23:32                     ` Stefan Monnier
2010-10-01 11:42           ` Richard Stallman
2010-10-01 20:36             ` Daniel Colascione
2010-10-01 11:42           ` Richard Stallman
2010-10-01 20:34             ` Daniel Colascione
2010-10-01 21:12               ` Chong Yidong
2010-09-27 19:07 ` MON KEY
2010-10-02  5:35   ` MON KEY
2010-10-04  2:03     ` Richard Stallman
2010-10-04  5:51       ` MON KEY
2010-10-06  5:21         ` Richard Stallman
2010-10-09  0:29           ` MON KEY
2010-10-10  5:09             ` Richard Stallman
2010-10-04 17:33       ` Daniel Colascione
2010-10-05  9:55         ` Richard Stallman
2010-10-05 10:20           ` Helmut Eller
2010-10-05 18:27             ` Eli Zaretskii
2010-10-06 23:41             ` Richard Stallman
2010-10-07 15:04               ` Ted Zlatanov
2010-10-07 15:17               ` Karl Fogel
2010-10-09  2:13                 ` Richard Stallman
2010-10-05 13:07           ` Ted Zlatanov
2010-10-06 23:41             ` Richard Stallman
2010-10-07  9:20               ` Daniel Colascione
2010-10-08  5:47                 ` Richard Stallman
2010-10-05 18:26           ` Eli Zaretskii
2010-10-06  0:29           ` MON KEY
2010-10-08  2:07             ` Christian Ohler
2010-10-08  2:18               ` Miles Bader
2010-10-08  3:15                 ` Christian Ohler
2010-10-06  8:04           ` Stephen J. Turnbull
2010-10-06  9:20             ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTikU7-2xj-uS87ENkEn=OgKGRM8F8+AP2f360XrX@mail.gmail.com' \
    --to=monkey@sandpframing.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.