[REBOL] Re: recursive directory copying...
From: Al::Bri::xtra::co::nz at: 14-May-2003 17:37
Anton wrote:
> Your unpack function's parse rule is setting 'File and 'Data.
> Should not those be declared local to the function?
> Maybe you ripped this func from some context that we are missing...
Indeed, the entire context is this:
make object! [
Unpacker: [
Rebol [
Name: 'Unpacker
Title: "Unpacker"
Date: (now)
Needs: [Core 1.2.8] ; Earlier versions of Rebol don't have a
correct 'make-dir.
Purpose: "Self-extracting file unpacker."
]
Unpack: func [Pack [block!]][
parse Pack [
some [
set File file! set Data binary! (
make paren! [
write/binary File decompress Data
]
)
| set File file! (
make paren! [make-dir/deep File]
)
]
end
]
]
Unpack ; 'Case goes here.
]
Note the Rebol header inside! :)
But you have reminded me that this is bad style! Bad, Andrew! I've been
setting a bad example. So here's how it should really look like:
Unpack: function [Pack [block!]] [File Data] [
;...
Andrew Martin
ICQ: 26227169 http://Valley.150m.com/