Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

cmp-length - compare the length of two series and return -1, 0, or 1, to support stable sorts by length

    ; Support func for stable sort comparator
    cmp-length: func [a [series!] b [series!] /local len-a len-b] [
        len-a: length? a
        len-b: length? b
        case [
            len-a < len-b [-1]
            len-a > len-b [1]
            len-a = len-b [0]
        ]
    ]
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS