|
|
last edited 6 years ago by test1 |
1 2 3 | ||
Editor: test1
Time: 2014/11/26 19:53:24 GMT+0 |
||
Note: |
added:
From test1 Wed Nov 26 19:53:24 +0000 2014
From: test1
Date: Wed, 26 Nov 2014 19:53:24 +0000
Subject:
Message-ID: <20141126195324+0000@axiom-wiki.newsynthesis.org>
Severity: normal => minor
the following commands:
bb:=[1,1, 2, 2, 2, 2, 1, 1, 1, 3, 1]
(1) |
sort! bb
(2) |
bb
(3) |
return:
bb = [1,1,2,2,2,2,3]
is sort! only intended for lists without repetition?
bb:=[1,1, 2, 2, 2, 2, 1, 1, 1, 3, 1]
(4) |
bb := sort! bb
(5) |
bb
(6) |
All ! functions destroy their arguement - this is as intended.
sort!
makes to
it's argument? To "sort in place" is very reasonable. Why not
return this sorted result in the argument as one would expect?
I have looked at older issues in Issue Tracker and it seems that
there are significant number of issues which are just users not
understanding what Axiom is doing and expecting different result.
For example 335 sort! drops list elements is just example of linked list. Something like:
(1) -> bb := [3, 4, 1, 2] (1) [3,4,1,2] Type: List PositiveInteger (2) -> bs := sort! bb (2) [1,2,3,4] Type: List PositiveInteger (3) -> bb (3) [3,4] Type: List PositiveInteger (4) -> bs (4) [1,2,3,4] Type: List PositiveInteger (5) -> bb.1 := 7 (5) 7 Type: PositiveInteger (6) -> bs (6) [1,2,7,4] Type: List PositiveInteger (7) ->
should be, or maybe already is in the tutorial, as an illustration that what was a first element of the list after reorganization may point inside.