[REBOL] Re: R: Re: List of all rebol words
From: tim-johnsons::web::com at: 8-Dec-2007 8:32
On Friday 07 December 2007, Giuseppe Chillemi wrote:
> > I think this works:
> > >> first system/words
> > == [end! unset! error! datatype! context! native! action! routine! op!
> > function! object! struct! library! port! any-type! any-word!...
> > >> length? first system/words
> > == 2488
> We have no description, no category, nothing... I need something more.
FYI: I transitioned from coding rebol in windows with Boxer, to
coding in linux with vim and then a few years ago, I started using
emacs and wrote a major emacs editing mode for rebol.
I'm speaking for emacs here not to encourage any debate about
the best editor but to qualify the approach that I used.
Since rebol doesn't distinguish between code and data and control
structures are functions with return values one might tailor the
approach to their own special needs. In emacs, syntax highlighting
groups are data structures which can be exploited for things like cursor
movement and selection routines.
I iterated thru first system words somewhat like this:
foreach word first system/words[
I started by programmatically capturing all of the type- words,
which are identified by
#"!" = last to-string word ;; UC = untested code
and built a temporary data structure of coerced strings
as in integer! => "integer" and so forth.
So now I had a collection of type words and a collection of
Then I iterated again and pulled out the type predicate words
with something like this:
ws: to-string word ;; UC
#"?" = last ws
(find ws coerced-string) = ws] ;; UC comparing "integer" and integer?
So now I had a list of types and type predicates
Then one can use either function? or any-function? to gather the functions,
=46rom that one can gather constants like newline, true, off etc.
A certain amount of hand editing was used, because control words,
loop words etc can evaluate to functions right?
I hope I've given you some ideas. I'm sure you want to tailor your
edit to both your needs and the editor's functionality.