On 30 September 2016 at 20:24, Alexander Burger <a...@software-lab.de> wrote: > Hi Rowan, > > the explanation is simple. > ... > It is the *return* value of 'sort' which is relevant: > ...
Ah, [facepalm], thanks. Because I hadn't used picolisp for a while, when I first used (sort) again in a new context I saw the altered (but not NIL) initial ("A") value before paying attention to the return-value, and was so convinced that it must be the meaningful part - and that (sort) must be "destructive and in-place" - that I never even looked at sort's return-value (or noticed that the documentation shows its return-values). Ironically picolisp code of mine from 2 years ago uses it correctly [sigh]. I suggest it might be more useful for newcomers, for people-with-terrible-memory, and for people-who-have-to-do-too-much-context-switching (like me) if the first sentence at http://www.software-lab.de/doc/refS.html#sort changed from: > Sorts lst by destructively exchanging its elements. to something more explicit like: > Returns a sorted lst by destructively exchanging the original lst's elements. I realise the examples implicitly show the "returns..." part of this, but it is easy to get distracted from that by the initial "lst" being transformed (but not NIL-ed) in such initially surprising ways. I guess there may be other "destructive but not in-place" functions whose documentation this suggestion could be relevant to as well. Of course you might feel that is being too verbose in order to pander to the n00bs and the forgetful though... -- Rowan Thorpe PGP fingerprint: BB0A 0787 C0EE BDD8 7F97 3D30 49F2 13A5 265D CCBD ---- "A riot is the language of the unheard." - Dr. Martin Luther King "There is a great difference between worry and concern. A worried person sees a problem, and a concerned person solves a problem." - Harold Stephens "Ignorance requires no apologies when it presents questions rather than assertions." - Michael Sierchio (OpenSSL mailing list) "What we need more than an end to wars is an end to the beginning of all wars." - Franklin Roosevelt -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe