> --- Tim Johnson wrote: ---

>   ; untested code!
>   context.....[
>      validate: func[args[block!] /local keywords][
>         keywords: self/__dict__ 
>         foreach [arg value] args[
>             if not find keywords arg[
>                 throw-an-error
>                 ]
>             ]
>         ]
>   ]

another way to code the above (but this also support validating just one word):

context [
        validate: func [word [block! word!] /local item][
                either block! = type? word [
                        foreach item word [
                                if not (validate item) [return false]
                        ]
                        return true
                ][
                        either found? in self word [true][false]
                ]
        ]
]


IMHO, I find this version a little bit more readable.


tim, this is not a challenge to your coding skills... I just like to show different 
views of a problem, for academic purposes.... this helps novices a lot.



-Max

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to