Anonymous user
Sort a list of object identifiers: Difference between revisions
m
→{{header|zkl}}: fix link
(→{{header|zkl}}: added code) |
m (→{{header|zkl}}: fix link) |
||
Line 244:
=={{header|zkl}}==
Basically, blow apart each line into a list of numbers and sort that.
<lang zkl>fcn sortOIDS(oids){
oids:=oids.pump(List(),fcn(oid){ oid[1,*].split(".").apply("toInt") });
oids.sort( // in place sort
fcn(a,b){ // a&b are (x,y,z,...), eg
a.zip(b).reduce(fcn(_,[(a,b)]){
if(a==b)return(True); // continue to next field
|