[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (n)reverse vs. length

From: David Kastrup
Subject: Re: (n)reverse vs. length
Date: Wed, 14 May 2014 22:12:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> 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),

Doesn't aset work on strings?

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]