Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,3 @@
list = [2, 4, 3, 1, 2]
IO.inspect Enum.sort(list)
IO.inspect Enum.sort(list, &(&1>&2))

View file

@ -1,3 +1,7 @@
nums = [2,4,3,1,2]
sorted = nums.sort # returns a new sorted array. 'nums' is unchanged
nums.sort! # sort 'nums' "in-place"
sorted = nums.sort # returns a new sorted array. 'nums' is unchanged
p sorted #=> [1, 2, 2, 3, 4]
p nums #=> [2, 4, 3, 1, 2]
nums.sort! # sort 'nums' "in-place"
p nums #=> [1, 2, 2, 3, 4]

View file

@ -2,5 +2,5 @@ fn main() {
let mut a = vec!(9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
a.sort();
println!("{}", a);
println!("{:?}", a);
}