[REBOL] Re: load, contexts and binding
From: ryanc:iesco-dms at: 18-Sep-2001 9:17
Robert M. Muench
wrote:
> > -----Original Message-----
> > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]On Behalf Of
> > Romano Paolo Tenca
> > Sent: Monday, September 17, 2001 8:31 PM
> > To: [rebol-list--rebol--com]
> > Subject: [REBOL] Re: load, contexts and binding
>
> > It is the opposite: after Load, the word "bla" in the loaded code will be
> > "bla is great!".
>
> Hi, hm... strange. Does this make sense? Why should I than load words from an
> external file? IMO it would make sense to be able to load words from files and
> overwrite the ones already defined in the running script.
This is standard operating procedure when loading a dialect, or just code you dont
want evaluated yet. If you want the code evaluated, use 'do, if you dont use
'load.
>
> > When you execute the loaded program, the loaded code will change the global
> "bla".
>
> I tried this too. But with the following:
>
> do load ...
>
> So 'load already redifined the new words... The problem with do is, that it
> expects a Rebol header, there is no refinement like do/plain ...
This is because when you 'do a file, your really doing ('do'ing?) a string. REBOL
code is normally not evaluated in a string until the REBOL header is found. I
suppose /plain refinement would be nice in certain instances, but 'do 'load really
isn't so bad.
Check out 'save/header. It tackles the problem from the right end by adding a
header to code you might want to leave around for later.
Have fun, --Ryan