|
Pages: [1]
|
 |
|
Author
|
Topic: System/words (Read 453 times)
|
guest_zapatta
Guest
|
Hello, I would like to know how to access to the context of some words newly declared in system/words. In my example, I make a reference list of all words in system/words. After, I load a rebol script with some definitions. Then I make the difference beetween my reference list an the new content of system/words. a0: next first system/words load to-file request-file b0: next first system/words delta: difference b0 a0
the delta block list all new variables loaded. But is it possible by this way to access to the types (functions, objects, local vars) of these loaded words ? get in system/words 'my-word ; or probe system/words/my-word ; doesn't work.
Thx, Z.
|
|
|
|
|
Logged
|
|
|
|
|
Gregg
|
Hard to say exactly, since it will depend on your needs. e.g. is there a reason you're LOADing the file, rather than DOing it?
I don't know if this will help but...
REBOL []
mark-my-words: context [ init: does [query/clear system/words] dump: does [ print ['Word tab 'Type tab 'Value] foreach word query system/words [ print [word tab type? get word tab mold get word] ] ] ]
mark-my-words/init
o: make object! [a: b: c: none set 'xx none] my-int: 23 I-have-issues: #this-is-my-biggest-issue fn: does [print "some fun now!"]
mark-my-words/dump
halt
|
|
|
|
|
Logged
|
|
|
|
|
Philippe
|
Gregg, Hard to say exactly, since it will depend on your needs. e.g. is there a reason you're LOADing the file, rather than DOing it?
I don't know if this will help but...
REBOL []
mark-my-words: context [ init: does [query/clear system/words] dump: does [ print ['Word tab 'Type tab 'Value] ...
My purpose is to find a simple way to find, and list all words including in a script. As you know, if you parse a script to define a such list, your parser should be huge, and take care about a lot a different cases (corresponding to each developper's usages). Another way is to use the internal properties of REBOL. Perhaps it's not a good idea ? But with your example, it is very easy to filter words by functions, objects, in scripts. I search a tool like that to identify quickly functions in scripts, and if possible, make graphical and hierarchic tree. ===Philippe
|
|
|
|
|
Logged
|
===Philippe
|
|
|
|
|
Pages: [1]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2314 Posts in 596 Topics by 4201 Members
Latest Member: preertFuesque
|