Gabriele wrote:
> Andrew wrote:
>  A> And here's a version that's shorter and nicer to use. Can any one
think of a shorter version?
>
> Yup. ;^)
>
> associate: func [block [block!] key value] [
>   head change/only any [
>     find/tail block key
>     insert tail block key
>   ] reduce [val]
> ]
>
> associate?: func [block [block!] key] [
>   all [key: select block key first key]
> ]

Thanks Gabriele! I just need to change this line:
        ] reduce [val]
    to:
        ] reduce [value]
    as there's a stray 'VAL running around in Rebol.

Andrew Martin
That Val is not my sister! :-)
ICQ: 26227169
http://members.ncbi.com/AndrewMartin/
http://members.xoom.com/AndrewMartin/
-><-


Reply via email to