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

pull function (See related posts)

    pull: func [
        "Remove and return items from a series."
        series [series! none!]
        /part "The number of items to pull; one is the default"
            range [number!]
        /local result
    ] [
        if none? series [return none]
        result: either part [copy/part series range] [pick series 1]
        either part [remove/part series range][remove series]
        result
    ]
    comment {
        b: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
        pull b
        pull/part b 2
        pull/part at b 3 10
        pull at b 14
    }

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


Click here to browse all 5147 code snippets

Related Posts