Anonymous user
Sort a list of object identifiers: Difference between revisions
m
→{{header|REXX}}: optimized the expansion for the sort to idiomatically find the largest OID.
m (→{{header|REXX}}: fixed a comment.) |
m (→{{header|REXX}}: optimized the expansion for the sort to idiomatically find the largest OID.) |
||
Line 992:
end /*m*/; return /* [↑] use a simple bubble sort. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
gen: w=1; #=words($);
/*length of the number of words in $.*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
adj: arg LZ; do j=1 for #; x= translate(@.j, , .); y= /*construct X version. */
do k=1 for words(x); _=word(x, k) /*get a number in X. */
if LZ then y= y right(_,
else y= y _ + 0 /* (elide) leading 0's*/
end /*k*/ /*adjust number, append*/
Line 1,004:
return /*── ─ ─ */
/*──────────────────────────────────────────────────────────────────────────────────────*/
show: do a=1
{{out|output|text= when using the (internal) default inputs:}}
<pre>
|