[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (n)reverse vs. length
From: |
Stefan Monnier |
Subject: |
Re: (n)reverse vs. length |
Date: |
Wed, 14 May 2014 15:10:47 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
> Should (n)reverse has the same semantics as length, i.e. accept
> vectors and strings as well?
Good question.
> IMHO this is the convenient and expected behavior from the point of
> view of the elisp programmer.
Elisp is pretty lame and messy in this respect.
E.g. we have elt/aref/nth which operate on various subsets of sequences.
We have mapc/mapcar which apply to lists and arrays (and strings), but
mapcar returns a list in any case.
I think it would be OK to make `reverse' work on arrays and strings.
I definitely don't want `nreverse' working on strings (strings should
be immutable), but I guess making it work on arrays is fine.
Stefan