Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: System/words
Pages: [1] Print
Author Topic: System/words  (Read 454 times)
guest_zapatta
Guest


Email
System/words
« on: March 09, 2006, 08:26:51 AM »

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.

Code:
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 ?


Code:
get in system/words 'my-word    ; or
probe system/words/my-word   ; doesn't work.
 



Thx,

Z.
Logged
Gregg
Newbie
*
Offline Offline

Posts: 27


View Profile WWW
Re: System/words
« Reply #1 on: April 24, 2006, 07:35:09 PM »

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
Newbie
*
Offline Offline

Posts: 34


View Profile WWW
Re: System/words
« Reply #2 on: May 15, 2006, 06:49:10 AM »

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] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: System/words
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2008, 08:30:27 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2315 Posts in 597 Topics by 4204 Members
Latest Member: hledamka.com

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc