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-4 of 4 total  RSS 

spec-block-to-named-block

spec-block-to-named-block: func [
    "Change all set-words in a spec block to regular words."
    input [block!]
][
    input: copy input
    parse input [
        some [mark: set-word! any-type! (change mark to word! first mark)]
    ]
    input
]

spec-block-is-subset? - is a spec block a subset of an object's spec?

spec-block-is-subset?: func [block [block!] object [object!]] [
    all [
        spec-block? block
        subset? first construct block  first object
    ]
]

spec-block-matches? - does a spec block match the spec for an object?

spec-block-matches?: func [block [block!] object [object!]] [
    all [
        spec-block? block
        equal? first construct block  first object
    ]
]

speck-block? function - does a block look like a spec block?

spec-block?: func [block [block!]] [
    parse extract block 2 [some [set-word!]]
]
« Newer Snippets
Older Snippets »
Showing 1-4 of 4 total  RSS