[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] sequence manipulation functions
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] sequence manipulation functions |
Date: |
Thu, 20 Nov 2014 18:16:28 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
> +(defun seq-filter (pred seq)
> + "Return a list of all the elements for which (PRED element) is non-nil in
> SEQ."
> + (delq 'seq--exclude (seq-map (lambda (elt)
> + (if (funcall pred elt)
> + elt
> + 'seq--exclude))
> + seq)))
This won't do the right thing if the list includes the symbol
`seq--exclude' (which could happen if this function is used by, say,
completion code). Better do a (defvar seq--exclude (make-symbol "exclude"))
and then use the value of `seq--exclude' rather than the constant
`seq--exclude'.
> + "Reduce the two-arguments function FUNCTION across SEQ, starting with
> INITIAL-VALUE.
This first line is too long. I guess we need to drop the "two-arguments" part.
> I have renamed the library "seq" instead of "sequences".
Good.
> seq-doseq macro, similar to dolist.
Actually seq-doseq is "unusable" on lists: it's O(N^2) instead
of O(N).
Otherwise, it looks fine, thank you,
Stefan
- RE: [PATCH] sequence manipulation functions, (continued)
- RE: [PATCH] sequence manipulation functions, Drew Adams, 2014/11/13
- Re: [PATCH] sequence manipulation functions, Leo Liu, 2014/11/14
- Re: [PATCH] sequence manipulation functions, Bozhidar Batsov, 2014/11/16
- Re: [PATCH] sequence manipulation functions, Nicolas Petton, 2014/11/16
- RE: [PATCH] sequence manipulation functions, Drew Adams, 2014/11/16
- Re: [PATCH] sequence manipulation functions, Stefan Monnier, 2014/11/16
- Re: [PATCH] sequence manipulation functions, Richard Stallman, 2014/11/16
- Re: [PATCH] sequence manipulation functions, Nicolas Petton, 2014/11/17
- Re: [PATCH] sequence manipulation functions, Stefan Monnier, 2014/11/17
- Re: [PATCH] sequence manipulation functions, Damien Cassou, 2014/11/16
- Re: [PATCH] sequence manipulation functions,
Stefan Monnier <=
- Re: [PATCH] sequence manipulation functions, Nicolas Petton, 2014/11/21
- Re: [PATCH] sequence manipulation functions, Stefan Monnier, 2014/11/21
- Re: [PATCH] sequence manipulation functions, Nicolas Petton, 2014/11/21
- Re: [PATCH] sequence manipulation functions, Stefan Monnier, 2014/11/21
- Re: [PATCH] sequence manipulation functions, Nicolas Petton, 2014/11/24
- Re: [PATCH] sequence manipulation functions, Nicolas Petton, 2014/11/24
RE: sequence manipulation functions, Drew Adams, 2014/11/05
Re: sequence manipulation functions, Damien Cassou, 2014/11/05