QUERY
Aidan Kehoe writes:
2010-09-16 Aidan Kehoe <kehoea(a)parhasard.net>
* byte-optimize.el (byte-optimize-apply): Transform (apply
'nconc (mapcar ...)) to (mapcan ...); warn about use of the first
idiom.
Why a warning here? I think that #'mapcan should be considered an
implementation detail that the programmer really ought not to need to
worry about, since you're always applying the optimization anyway.
It's possible that the programmer might have some reason to use the
"(nconc (mapcar ...))" form. For example, in
(defun vowel-p (symbol) (member 'vowel (get symbol 'character-properties)))
(put 'a 'vowel-p (cons 'vowel (get 'a 'character-properties)))
(put 'c 'vowel-p (cons 'vowel (get 'c 'character-properties)))
(mapcan #'vowel-p '(a b c d))
from the answer, you wouldn't be able to determine which list element
was tickling the bug, but with a "(nconc (mapcar ...))" form, you
could, using a debugger.
I would consider a "debug-level" or "info" message that the
programmer
requests by setting log-level or something reasonable, though.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches