You
might want to look at the definitions for "bind" and "use". Also, look at
the /local refinement by doing HELP FUNCTION.
Paul
Tretter
I've just started to play around with rebol. It
definately has it's = advantages for the beginner progammer but it seems
shows some weakness = for advanced, modular based programming. For example,
all user/system = defined variables are either global (or local to a
function). Since all = variables are global in rebol and there is no way to
associate a = variable with a class, this would probably lead to collisions
when you = are using lot's of scripts.=20
imagine someone wrote a
utility script with a bunch of reusable = functions. Let's say you want to
use those functions in your script. If = the original script uses a global
variable with the same name as a = global var you used in your script, it
would cause a collision.=20
Or let's say that the programmer of a
utility script reimplemented a = rebol defined function such as "print."
Now when you add his utility = script to your script, the function print
get's all screwed up in either = your script or his script.=20
Java
and javascript have a much less chance of these collisions since = the
programmer can create static variable and functions that are = associated
with a class. These vars and functions can be accessed = globally, but must
have the name of the class in front of the variable. = for
example,
Math.pi=20
could be a variable pi defined in class Math
that can be accessed = globally.it is not an instance variable, it is a
static variable. = Outside of the class Math, you have to use "Math" before
it in order to = access it.
Perhaps I haven't studied the language
in enough detail yet, but = wouldn't you all agree that this is a weakness
in rebol? It doesn't seem = that well suited for modular based programming
as is. Maybe I'm missing = something but I don't see why the author did it
this way...
Rishi
|