From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.devel Subject: moving more cl seq/mapping support into core Date: Fri, 24 Sep 2010 18:48:26 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1285368563 8042 80.91.229.12 (24 Sep 2010 22:49:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Sep 2010 22:49:23 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 25 00:49:22 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OzH50-0000kv-0o for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 00:49:22 +0200 Original-Received: from localhost ([127.0.0.1]:36752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzH4F-0000D4-Tm for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 18:48:35 -0400 Original-Received: from [140.186.70.92] (port=57304 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzH49-0000Cj-Ub for emacs-devel@gnu.org; Fri, 24 Sep 2010 18:48:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzH48-0001xq-Dc for emacs-devel@gnu.org; Fri, 24 Sep 2010 18:48:29 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:36076) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzH48-0001xf-5d for emacs-devel@gnu.org; Fri, 24 Sep 2010 18:48:28 -0400 Original-Received: by wyb36 with SMTP id 36so3914581wyb.0 for ; Fri, 24 Sep 2010 15:48:26 -0700 (PDT) Original-Received: by 10.227.152.18 with SMTP id e18mr3600232wbw.1.1285368506582; Fri, 24 Sep 2010 15:48:26 -0700 (PDT) Original-Received: by 10.216.67.195 with HTTP; Fri, 24 Sep 2010 15:48:26 -0700 (PDT) X-Google-Sender-Auth: Xq-SbLOb-kkvetMAJWNMwrWlLd8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130815 Archived-At: ,---- | :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\