[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] sequence manipulation functions
From: |
Nicolas Petton |
Subject: |
Re: [PATCH] sequence manipulation functions |
Date: |
Fri, 21 Nov 2014 13:40:42 +0100 |
User-agent: |
mu4e 0.9.9.6pre3; emacs 24.3.1 |
Stefan Monnier <address@hidden> writes:
>> +(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'.
Indeed.
>
>> + "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.
Ok, I will do that.
>
>> 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).
The macro could use to "dolist" if the sequence is a list.
>
> Otherwise, it looks fine, thank you,
>
>
> Stefan
--
Nicolas Petton
http://nicolas-petton.fr
- Re: [PATCH] sequence manipulation functions, (continued)
- 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, 2014/11/20
- Re: [PATCH] sequence manipulation functions,
Nicolas Petton <=
- 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
RE: sequence manipulation functions, Drew Adams, 2014/11/05