|
|
last edited 6 years ago by test1 |
1 2 3 | ||
Editor: test1
Time: 2018/05/10 20:21:49 GMT+0 |
||
Note: |
added:
From test1 Thu May 10 20:21:49 +0000 2018
From: test1
Date: Thu, 10 May 2018 20:21:49 +0000
Subject:
Message-ID: <20180510202149+0000@axiom-wiki.newsynthesis.org>
Status: open => closed
the following commands:
(1) -> 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.
Severity: normal => minor Status: open => closed