Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
|
|
@ -0,0 +1,4 @@
|
|||
sorttable(T; ordering=<, column=1, reverse=false) =
|
||||
sort(T, by = t -> t[column], lt = reverse ? (a,b) -> ordering(b,a) : ordering)
|
||||
sorttable(T, ordering=<, column=1, reverse=false) =
|
||||
sorttable(T, ordering=ordering, column=column, reverse=reverse)
|
||||
17
Task/Optional-parameters/Julia/optional-parameters-2.julia
Normal file
17
Task/Optional-parameters/Julia/optional-parameters-2.julia
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
julia> data = {["a", "b", "c"], ["", "q", "z"], ["zap", "zip", "Zot"]}
|
||||
3-element Array{Any,1}:
|
||||
["a","b","c"]
|
||||
["","q","z"]
|
||||
["zap","zip","Zot"]
|
||||
|
||||
julia> sorttable(data, column=2, reverse=true) # named arguments
|
||||
3-element Array{Any,1}:
|
||||
["zap","zip","Zot"]
|
||||
["","q","z"]
|
||||
["a","b","c"]
|
||||
|
||||
julia> sorttable(data, >, 2) # the same thing, with positional arguments
|
||||
3-element Array{Any,1}:
|
||||
["zap","zip","Zot"]
|
||||
["","q","z"]
|
||||
["a","b","c"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue