[REBOL] Re: Re(3): 'parse-url - where defined?
From: larry:ecotope at: 31-Jan-2001 10:29
> Thanks guys,
> I've got DocKimbel's help patch,
> and Bo's browse-system.r.
> I really do need to spend some time
> poking through the system object more.
Yes! Currently that is the only way to move to guru status.
> One question:
> Is everything contained in the system object?
Short answer: Yes. Actually SYSTEM also has another name REBOL, it is the
root of the rebol system.
> Are all objects in 'system ?
Yes, but only those which are built-in at startup appear in the system
hierarchy. Of course, you can add to or modify the hierarchy (exercise
>> system/user: make system/user [nick: "sneaky"]
>> help system/user
email -- (Type: email)
home -- (Type: none)
name -- (Type: none)
nick -- (Type: string)
words -- (Type: none)
So we have actually redefined part of the REBOL system.
> All words and objects defined by me -
> do they end up in 'system somewhere?
Yes, but not in the system hierarchy (unless you put them there as above).
In one sense of your question, "everything" is in system/words. It is the
dictionary or symbol table for the current invocation. The expression
gives a block of all words seen by the scanner whether defined or not, in
second/system/words gives the corresponding block of *globally* known values
(may be unset!). In other words, it only gives a value if the word has a
value in the global context.
A good example of using these is:
To track what you have defined, put this in your user.r
Then at any point in a script or console session,
>>find first system/words 'antons-stuff
returns a list of all the words you have used and their values (in the
global context) are the corresponding entries in the block returned by
May the source be with you, young Jedi ;-)
PS Things are actually a little more complicated than indicated above, but
this will put you on the right track.