rebol 中的递归问题
我有一个块,我想
folders: [
Chrome [
content [
preferences
prefpages
]
]
icons [
default
]
locale [
en-EN [
csbar
]
]
skin
]
用这个函数递归迭代:
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
]
]
]
但由于愚蠢的原因我看不到,探针文件夹上面没有返回任何内容,所以它不起作用。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为是选择文件夹文件夹搞乱了它......文件夹已经是你想要的数据结构了。
试试这个(还要注意询问而不是输入只是为了在此时添加调试字符串):
It's that select folders folder that is messsing it up, I think.....folder is already the data structure you want.
Try this (note also the ask rather than input just to add a debugging string at that point):