tags:

views:

28

answers:

1

There is a new funct function in rebol which allows to make variables automatically bound to local context.

What's the difference with ladislav funcs here: http://www.fm.vslib.cz/~ladislav/rebol/funcs.r

funct has a problem with value? function as it returns true even if a variable has not been set at runtime yet, does funcs has the same drawbacks ?

+1  A: 

The main difference is, that FUNCT deep-searches for set-words in the body, while FUNC just shallow-searches for them.

FUNCS has been around (a name change occurred not long ago, though) for quite some time.

FUNCS uses a slightly different specification.

That VALUE? function "problem" is generally related to the fact, that the local variables of functions are initialized to NONE, which causes the VALUE? function to yield TRUE even when the variables are "not initialized yet". (generally, I do not see this "initialized with NONE" a "big deal", although this behaviour is not consistent with the behaviour of either global or object variables)

Ladislav
For me it's a big deal because I often want to test optional parameters. Refinement is not always user friendly I prefer to be able to ignore params.
Rebol Tutorial
I am still not sure you understand the VALUE? issue. I wrote the example code supposing you to run it to see what is it about.
Ladislav
Regarding testing for optional parameters: it is possible anyway.
Ladislav