Hi Joel

Just a small clarification. You wrote:


    >> searchname: func [who [string!] /local k v] [
    [    foreach [k v] foo [
    [        if v/name = who [return v]
    [        ]
    [    ]

Actually the declaration of k and v as local vars to the searchname function
is unnecessary as in your example they are never used.  The foreach function
binds the words in it's first arg (also k and v in your example) as local to
it's own context. The outer k and v are unused. Here is a short example:

>> f: func [/local k][
[    k: 1
[    foreach [k]["a" "b"][print k]
[    print k
[    ]
>> f
a
b
1
>>

Cheers
-Larry



Reply via email to