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

cmp-length - compare the length of two series and return -1, 0, or 1, to support stable sorts by length (See related posts)

    ; 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]
        ]
    ]

You need to create an account or log in to post comments to this site.


Click here to browse all 4834 code snippets

Related Posts