[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4] Bound index checks in cl-seq functions
From: |
Tino Calancha |
Subject: |
Re: [PATCH v4] Bound index checks in cl-seq functions |
Date: |
Fri, 10 Feb 2017 16:43:49 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Tino Calancha <address@hidden> writes:
> Consider following evaluations:
>
> (cl-position 2 (list 1 2 3) :start -999)
> => -998
> (cl-position 2 (list 1 2 3) :start 999)
> => nil
> (cl-position 2 (list 1 2 3) :start 1 :end 0)
> => nil
>
> *) In the first two, the indices are out of range.
> *) In the 3rd, the start index is higher than the end index.
>
> Guy L. Steele recommends to throw an error in those cases:
> http://www.lispworks.com/documentation/HyperSpec/Issues/iss332_w.htm
>
> We have partially done the job, at least for `cl-subseq':
> (cl-subseq (list 1 2 3) 999)
> ; Signal: "Bad bounding indices: 999, nil"
>
> (cl-subseq (list 1 2 3) -999)
> ; Signal: "Bad bounding indices: -999, nil"
>
> (cl-subseq (list 1 2 3) -1)
> => (3) ; This is OK as documented in the docstring.
>
> See:
> https://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00182.html
>
> It would be nice if all the sequence functions in cl-seq.el
> throw errors in those situations.
Dear maintainers,
do you agree with pushing to master the patch v4 for this thread ?
Here:
https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00191.html
Any further suggestion/comment or something to address?
Thanks,
Tino
Re: [PATCH v4] Bound index checks in cl-seq functions,
Tino Calancha <=
Re: [PATCH] Bound index checks in cl-seq functions, Johan Bockgård, 2017/02/12