r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3]

Steeve
23-Jan-2012
[9883]
newly-defined
 is confusing :-)
Ladislav
23-Jan-2012
[9884x2]
Terminological problem, yes
However, I do not track "modified", since that is a bit more complicated/slower 
than I like.
Steeve
23-Jan-2012
[9886]
Still I wonder, what is the so called defined? function ?
Where can I find it ?
Oldes
23-Jan-2012
[9887x4]
Steeve... I guess Ladislav is looking for something like this R2 
helper script:
gbl-test: func [
    code
    /all
    /init {returns string with all global variables set to none}
    /local gbl-list words str_init
][
    words: make block! 50
    str_init: make string! 1000
    gbl-list: query/clear system/words
    do code
    if block? gbl-list: query system/words [
        foreach item gbl-list [
            if any [all value? item] [
                insert tail words to-word item
                if init [
                    insert tail str_init join to-word item ": "
                ]
            ]
        ]
    ]
    if init [
        write clipboard:// join str_init "none"
    ]
    words
]
>> gbl-test [a: 1]
== [a]
>> f: func[a][b: a + 1] gbl-test [f a: 1]
== [a b]
The above script I was using to detect leaking variables
>> gbl-test [ o: context [a: 1] ]
== [o]
>> gbl-test [ o: context [a: 1 set 'b 2] ]
== [b o]
(of course without the init part - that was for my personal use) 
it's pretty old script, I almost forgot I have it:)
Steeve
23-Jan-2012
[9891x2]
Ok ok, but I just want to have a look on the functions Cyphre pointed 
out :)
I suspect something odd ;-)
Oldes
23-Jan-2012
[9893x2]
Ah.. I see... the defined? function is not defined:)
I should try it first, my mistake.
Ladislav
23-Jan-2012
[9895x3]
defined?: func either rebol/version >= 2.100.0 [[
	{find all defined words in the given context}
	context [any-object!]
	/local words
]][[
	{find all defined words in the given context}
	context [object!]
	/local words	
]][
	words: first context
	remove-each word words [not value? word]
	words
]
ah, bad code, needs correction
this looks more likely:

defined?: either rebol/version >= 2.100.0 [
	func [
		{find all defined words in the given context}
		context [any-object!]
		/local words
	][
		words: words-of context
		remove-each word words [not value? word]
		words		
	]
][
	func [
		{find all defined words in the given context}
		context [object!]
		/local words	
	][
		words: bind first context context
		remove-each word words [not value? word]
		words
	]
]
Steeve
23-Jan-2012
[9898]
Thanks
Pavel
21-Feb-2012
[9899]
One year left from last Carl's blog entry in R3 blog. Sad anniversary.
Pekr
21-Feb-2012
[9900]
Yes, indeed. We should concetrate upon what we have. And we have 
clones, plus existing RT's products, which are still useable, although 
we would like to see them progress further. If Carl does not return 
to R3 one day, nor does he release its sources, it was big 5+ years 
of wasted time imo ...
GrahamC
21-Feb-2012
[9901]
Not a waste ... it has provided the drive to produce derivatives
Kaj
21-Feb-2012
[9902]
It also suppressed the production of derivatives at the time
GrahamC
21-Feb-2012
[9903]
To be fair, that is because it was good enough
Maxim
21-Feb-2012
[9904x2]
yes, it is usable.
but its missing a few key things which prevent a few few of us from 
moving to it.
Kaj
21-Feb-2012
[9906:last]
No, there was already a drive to produce derivatives, because it 
wasn't good enough, and it was killed