Hello Joachim!

On 04-Nov-00, you wrote:

 JT> By the way, is there a method to search (deep/recutsively)
 JT> into block, not only at the first level? And accessing into

It's probably slow, but:

  find-deep: func [block [any-block!] value /local res] [
    forall block [
      any [
        if any-block? block/1 [
          if res: find-deep block/1 :value [break/return res]
        ]
        if block/1 = :value [break/return :block]
      ]
    ]
  ]

>> find-deep myblock 'one                                 
== [one [1 2 3]]
>> find-deep myblock 3   
== [3]
>> find-deep myblock 7
== [7 8 9]

Depending on your application, this might be speeded up using the
native FIND.

 JT> blocks, like myblock/1/2/3 using indexes/variables and not
 JT> direct references?

Did you mean something like this?

>> i: 1 j: 2 k: 3
== 3
>> myblock/:i/:j/:k
== 3
>> pick pick pick myblock i j k
== 3

Regards,
    Gabriele.
-- 
Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to