Problem with recursivity in rebol

Posted by Rebol Tutorial on Stack Overflow See other posts from Stack Overflow or by Rebol Tutorial
Published on 2010-03-21T11:05:56Z Indexed on 2010/03/21 11:11 UTC
Read the original article Hit count: 489

Filed under:

I have a block on which I want to iterate recursively

folders: [
    Chrome [
        content [
            preferences
            prefpages
        ]
    ]
    icons [
        default
    ]
    locale [
        en-EN [
            csbar
        ]
    ]
    skin
]

with this function:

iterate-folder: func [folders [block!]][
    foreach folder folders [
        either not block? folder [
            probe folder
            temp: folder
            input
        ] [
            print "folder"
            probe folder
            print "folders"
            probe folders
            probe select folders folder
            type-folder: type? select folders folder
            probe type-folder
            input
            iterate-folder select folders folder
        ]
    ]
]

but for stupid reason I can't see, probe folder returns none above so it doesn't work.

© Stack Overflow or respective owner

Related posts about rebol