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

World: r3wp

[!REBOL3 Schemes] Implementors guide

Pavel
13-Aug-2010
[2221]
I made it 
read: func [port [port!] /seek number [integer!] ] [

		either empty? port/locals [
		open port
            	return Get-RIF port number
		][
		return Get-RIF port number
		]

and it works now
Steeve
13-Aug-2010
[2222]
Btw Pavel, in my virtual-block scheme, the reason why I rebound the 
actors, is that I don't like to use nasty long path to acces my locals.
Pavel
13-Aug-2010
[2223x2]
I hope close is in garbage collector as mentioned in wiki
And second is more speed?
Steeve
13-Aug-2010
[2225]
It should be :-)
Graham
13-Aug-2010
[2226x2]
can't you 

return get-rif either empty? ...
or 

if empty? port/locals [ open port ]
get-rif port number
Pavel
13-Aug-2010
[2228]
graham it is better thanks
Graham
13-Aug-2010
[2229]
we should rename this group to !REBOL schemes
Steeve
13-Aug-2010
[2230]
but we"re missing a rename actor
Graham
13-Aug-2010
[2231x2]
we can use a proxy actor
Ahh.... I can rename :)
BrianH
13-Aug-2010
[2233x2]
Pavel, the names for the get/put operations of key-value stores are 
PICK and POKE.
We have a separate !REBOL3 Schemes group on purpose. Please don't 
rename it.
Andreas
13-Aug-2010
[2235]
We didn't have a separate !REBOL3 Schemes group.
BrianH
13-Aug-2010
[2236]
We created a bunch of spinoff groups because !REBOL3 was getting 
too busy.
Andreas
13-Aug-2010
[2237x2]
I guess you took the "!REBOL Schemes" too literally. It is "!REBOL3 
Schemes" Graham intented, and in fact, already renamed this group 
to. (It was "!REBOL3 Network Schemes" previously.)
intended*
BrianH
13-Aug-2010
[2239]
OK, cool. That is shorter :)
Andreas
13-Aug-2010
[2240]
Yeah. And more approriate :)
Graham
13-Aug-2010
[2241]
Wasn't this group orginally named "Graham's foray into scheme arcana" 
 or something similar??
Steeve
13-Aug-2010
[2242]
scheme on you
BrianH
13-Aug-2010
[2243]
Pavel, you were right the first time in trying to implement GET/PUT 
actors, but you got the names wrong. Try again with PICK and POKE.
Graham
13-Aug-2010
[2244]
get: :pick
put: :poke
BrianH
13-Aug-2010
[2245]
Metaphorically, yes. Literally, that will break REBOL :)
Graham
13-Aug-2010
[2246]
basic: :rebol
Anton
14-Aug-2010
[2247]
I think the group name should be tweaked a bit more to remove the 
"Scheme" inside the bracketed part. I don't see the need to have 
it mentioned twice.
Gregg
14-Aug-2010
[2248]
Done.
Steeve
28-Aug-2010
[2249x2]
Any example how to process inputs from the console's port while processing 
other ports using WAIT ?

I looked at the source of the input function, but it doesn't help....
I tried to launch a task! to wait for other port inputs and to keep 
the console safe.
But WAIT seems not working inside a task!
NickA
4-Sep-2010
[2251x2]
Is this helpful?:

print ""
q: open/binary/no-wait [scheme: 'console]
count: 0
forever [
    count: count + 1
    if not none? wait/all [q :00:00.01] [
        wait q
        qq: to string! copy q
        probe qq

        print ["^/loop count incremented to" count "while waiting^/"]

        insert s: open sound:// load %/c/windows/media/tada.wav wait s close 
        s
    ]
]
Oops - sorry, didn't see that this was R3 Schemes group.
Pavel
20-Dec-2010
[2253]
How to pass a received data from awake handler to actor level? I 
can do Print port/data it works, but I need return a value from read 
actor
Steeve
20-Dec-2010
[2254x4]
you can't return data from the awake handler
you just can stop it
*only*
And you don't need to pass data, they both share the same context 
via the port parameter
Kaj
20-Dec-2010
[2258]
Wow, lots of documentation on the wiki. That will be very helpful
Pavel
21-Dec-2010
[2259]
There is alot of doc in wiki, but the examples is to be written yet, 
that is why I asked. BTW all the simply schemes at Graham Chiu's 
site  (il dottore :) simply doesn work for me, and yes I've upgraded 
make-scheme to sys/make-scheme for A110. Unfortunately the only scheme 
I know working is the http scheme, but it is too high class to I 
can understand the process.
GrahamC
21-Dec-2010
[2260]
daytime doesn't work??
Pavel
21-Dec-2010
[2261x2]
I've tryed to make time scheme from your daytime scheme Graham, as 
I noted when I put print at awake level as You did for debug probably 
I can see the server response, but I'm not able to get response at 
the 
read time://server.site
== somenumber
There is missing the "; make something synchronous here" part :-)
Kaj
21-Dec-2010
[2263]
I think Christian Ensel's ODBC scheme is the other current example
Pavel
23-Dec-2010
[2264]
Interresting, when I write to global variable at awake level everything 
works OK. Somebody give me a hint how to send received data from 
awake to actor level please.
Steeve
23-Dec-2010
[2265]
An awake functions deals with events.
An event has a port  property.
An actor takes a port as input parameter.
Here the link.

If the port contains locals vars, they can both (the awake and the 
actor) access the port's locals.
Pavel
23-Dec-2010
[2266]
And from subport (tcp) to scheme level port? Can low level awake 
write directly to scheme locals?
Steeve
24-Dec-2010
[2267]
Sure, they both share a cross reference in their locals, like in 
R2.
Pavel
27-Dec-2010
[2268]
Finally I've got it, so now I have a time scheme returning (RFC 868) 
integer number of seconds from 1-Jan-1900. I tried to define refinement 
/date to return well formated date!. But there is no possibility 
to define different refinement except of hadcoded one so I have to 
use /lines for that, silly.
ChristianE
27-Dec-2010
[2269]
Would you mind to show the interface/api or the actual implementation 
of your time scheme? You're probably (mis-)using the /LINES refinement 
of READ, but maybe you can instead use WRITE for that ...
Pavel
28-Dec-2010
[2270]
ChristianE the idea arises from the fact the time server send only 
response and close immediately, so I only implemented Read actor. 
The problem is that you may not create a new refinement but only 
redefine one existing. 

time scheme needs a little polishing and will be posted to script 
library.

Anyway you are right the only possibility how to controll the scheme 
in wider borders is to write a command block and wait for reply. 
Another not so generall would be write into port state context and 
use this as switch for read actor.