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

World: r3wp

[!REBOL3]

BrianH
5-Dec-2011
[9856x2]
There is a cross-platform bug in R3 where it won't see any file or 
directory that starts with two periods, not just . and .. - the ticket: 
http://issue.cc/r3/1899
This may be unrelated though.
Henrik
5-Dec-2011
[9858]
It is possible to make this directory under OSX, as far as I can 
see.
BrianH
5-Dec-2011
[9859]
The particular error triggered in the Windows console when you try 
to make a directory with only periods in its name is that the directory 
already exists; this is probably a bad error. However, when you try 
to MAKE-DIR directories that already exist in REBOL, it's a noop, 
not an error. That is probably why it's not triggering an error here.
Marco
11-Dec-2011
[9860]
wish for R3 / Topaz / Red / World:

callback! datatype so you can "really" use a lot of nice shared libraries.
Geomol
11-Dec-2011
[9861]
Do you have a simple example?
Marco
11-Dec-2011
[9862]
display: make callback! [...] [...]
glutDisplayFunc :display
Kaj
11-Dec-2011
[9863]
Red/System has native callbacks already. I'm using them in most library 
bindings
Marco
11-Dec-2011
[9864]
Right. Red/System seems vary nice.

I am waiting for floats to be implemented in Red/System. Is there 
a "math" library that could be used intead?
Kaj
11-Dec-2011
[9865]
I've bound the standard C math library already, but it's waiting 
for the floats
BrianH
11-Dec-2011
[9866x2]
With R3 you can just callback functions if you want a synchronous 
call, or callback through an event if you want to go asynchronous.
Still, a generator of marshalling wrapper functions would be nice, 
especially since REBOL and C don't have similar data models.
Robert
11-Dec-2011
[9868]
But R3 can't deal very good with multi-threaded libs. You need to 
trick it: Use async with non or integer value to trigger a sync call 
on Rebol side.
Steeve
29-Dec-2011
[9869]
Any info about the algorithms used to construct and perform lookup 
on symbol's tables in R3 ?
People gave some hints back in the day.
But I can't remember who.
Ladislav
22-Jan-2012
[9870]
Wondering if there is an analogy of

    query/clear system/words
BrianH
22-Jan-2012
[9871]
Now that you mention it, I'm wondering that too. There isn't any 
tracking of state changes for R3 objects that I'm aware of, and there's 
nothing like system/words.
Ladislav
22-Jan-2012
[9872]
Well, it is not a big "disaster" for me, since it is not too hard 
for me to adjust the function I am writing for R3 with just a slight 
modification of the behaviour...
Cyphre
23-Jan-2012
[9873]
Ladislav, I think you already wrote something like that for R3?

newly-defined?: func [
	{do the given BLOCK and find the newly-defined words}
	block [block!]
	/local old
] [
	old: append append
		defined? system/contexts/lib
		defined? system/contexts/sys
		defined? system/contexts/user
	do block
	exclude defined? system/contexts/user old
]
Steeve
23-Jan-2012
[9874]
Cyphre, it's not a good approach in R3

To track newly defined words in a context you can check the source 
of the function INTERN.
Ladislav
23-Jan-2012
[9875]
I may be completely missing the point, Steeve. How exactly can the 
source of the INTERN function help with detection?
Steeve
23-Jan-2012
[9876]
Its tracking newly "created" words in the user context after a binding. 
It's maybe not what you're trying to do but it was in response to 
Cyphre.
Ladislav
23-Jan-2012
[9877x2]
What I (essentially) want is described in the help string:

    {do the given BLOCK and find the newly-defined words}

Can the source of INTERN cannot help me with that?
typo: "Can the source of INTERN help me with that?
Steeve
23-Jan-2012
[9879]
I probably mistaken the words "newly-defined" for "newly-created"
Ladislav
23-Jan-2012
[9880]
I originally pointed out how implemented the functionality in R2 
(using the 

    query/clear system/words

expression.
Steeve
23-Jan-2012
[9881x3]
You want to track the "modified" words, right ?
ok
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.