Sort a list of object identifiers: Difference between revisions

Content added Content deleted
No edit summary
Line 211: Line 211:
Factor provides the <code>human<=></code> word which converts numbers in a string to integers before comparing them.
Factor provides the <code>human<=></code> word which converts numbers in a string to integers before comparing them.
<lang factor>USING: io qw sequences sorting sorting.human ;
<lang factor>USING: io qw sequences sorting sorting.human ;
IN: rosetta-code.sort-object-ids


qw{
CONSTANT: input qw{
1.3.6.1.4.1.11.2.17.19.3.4.0.10
1.3.6.1.4.1.11.2.17.19.3.4.0.10
1.3.6.1.4.1.11.2.17.5.2.0.79
1.3.6.1.4.1.11.2.17.5.2.0.79
Line 220: Line 219:
1.3.6.1.4.1.11.2.17.19.3.4.0.1
1.3.6.1.4.1.11.2.17.19.3.4.0.1
1.3.6.1.4.1.11150.3.4.0
1.3.6.1.4.1.11150.3.4.0
} [ human<=> ] sort [ print ] each</lang>
}

input [ human<=> ] sort [ print ] each</lang>
{{out}}
{{out}}
<pre>
<pre>