[REBOL] Forward References
From: richard-boyd::worldnet::att::net at: 13-Dec-2001 21:57
The REBOL/Command User Guide page 8-29 states ..
--Forward References--
Sometimes a script needs to refer to a function before it has been
evaluated. This can be done as long as the variable for the function is
not evaluated before it is defined.
How do you determine if the referenced function is "evaluated" before it
is defined? Must you order all definitions within a file so that the
definitions always come before reference is made to them? Any
references/weblinks with clarification?
Thanx.
-richard-
-------------- REFERENCE BEFORE WORKS ------------------
REBOL [Title: "Forward Reference"]
open-new-pane: func
[]
[view layout
[banner "New Window"
button "Quit" [quit]
button "Unview" [unview]]]
view layout
[banner "Forward Reference Test"
button "New Pane" [open-new-pane]]
-------------- REFERENCE AFTER FAILS ------------------
REBOL [Title: "Forward Reference"]
view layout
[banner "Forward Reference Test"
button "New Pane" [open-new-pane]]
open-new-pane: func
[]
[view layout
[banner "New Window"
button "Quit" [quit]
button "Unview" [unview]]]