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

SET+ (See related posts)

    set+: func [ ; Inspired by Erlang's list model.
        "Like SET, but words block is dialected."
        words  [any-block!] "Word after | gets remainder of series."
        series [series!]
        /local word= rule=
    ][
        word=: [set word word!]
        rule=: [
            any [
                '| word= (set word series) to end
                | word= (
                    set word pick series 1
                    series: next series
                )
            ]
        ]
        parse words rule=
    ]
    ;set+ [a | rest] [1 2 3 4 5]
    ;set+ [a b | rest] [1 2 3 4 5]
    ;set+ [a b c] [1 2]

Comments on this post

akromose posts on May 30, 2006 at 12:58
lagos,Nigeria, calabar, bankpor-irruan, germany, abuja, united state of american, london,catholic, christan, researching, estate.

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


Click here to browse all 4852 code snippets

Related Posts