Hello All: 
        I would like to apply the same operation to all members of a nested block.
;Example: 
blk: [[1 2 3 4] [5 6 7 8] [9 10 11 12] [13 14 15 16 17] "one"]
blk: do-all blk next ; set all members to next element
;result sought:
>>[[2 3 4] [6 7 8] [10 11 12] [14 15 16 17] "ne"]
blk: do-all blk head ; set all members to head
; result sought:
>>[[1 2 3 4] [5 6 7 8] [9 10 11 12] [13 14 15 16 17] "one"]
; I've started by this simple function, which is not doing just
; what I want:
REBOL[]
do-all: func[blk[block!] ][ ;cmd[word!]
        foreach member blk[
                if series? member[
                        member: next member
                        print mold member
                        ]
                ]
        blk
        ]
test: [[1 2 3 4] [5 6 7 8] [9 10 11 12] [13 14 15 16 17] "one"]         
print mold do-all test 
;and I get
>> do %sample.r
Script: "Untitled" (none)
[2 3 4]
[6 7 8]
[10 11 12]
[14 15 16 17]
"ne"
[[1 2 3 4] [5 6 7 8] [9 10 11 12] [13 14 15 16 17] "one"]

TIA
-- 
Tim Johnson <[EMAIL PROTECTED]>
       http://www.johnsons-web.com
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to