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

World: r3wp

[!REBOL3 Schemes] Implementors guide

Graham
21-Jan-2010
[1763]
parse documentation is very skimpy .. .need lots of new examples
BrianH
21-Jan-2010
[1764]
There are more than a few FIND bugs. Check CureCode to see if yours 
is covered already.
Maxim
21-Jan-2010
[1765]
graham, can't you just use the return keyword in R3 parse?
BrianH
21-Jan-2010
[1766]
PARSE documentation is actually pretty extensive, but not yet organized. 
There was a lot of thorough research conducted during the parse project 
and revamp. It just hasn';t been put into the docs yet.
Graham
21-Jan-2010
[1767x2]
it's not there in curecode
but it's more subtle ... as it works outside the function
Steeve
21-Jan-2010
[1769]
(reworking on ftp scheme currently )
Graham
21-Jan-2010
[1770]
going to implement ftp site to site transfer ?  :)
Steeve
21-Jan-2010
[1771]
yup, i need it for PC to AS400 file's exchanges
Graham
21-Jan-2010
[1772]
So, I have some bugs in my scheme?
Steeve
21-Jan-2010
[1773x2]
and remote commands too
well, missing lot of commands :)
Graham
21-Jan-2010
[1775x4]
oh yeah ...minimal functionality ... for someone else to finish ;)
cwd: func [ mbox [port!] dir [string!]][
	if in mbox/scheme/actor 'cwd [
		mbox/scheme/actor/cwd dir
	]
]
which is what I have in my imap scheme ... could use similar for 
ftp
actor: [
	cwd: funct [ dir [string!]][
			write mbox compose [ SELECT (dir) ]
			read mbox
		]
]
Steeve
21-Jan-2010
[1779]
i'm doing differently currently, i only use WRITE to pass block of 
commands to parse
Graham
21-Jan-2010
[1780]
so the user still has low level access to the scheme or not?
Steeve
21-Jan-2010
[1781]
don't know what u mean exactly, so i would say... maybe
Graham
21-Jan-2010
[1782]
the user can still use the port in what carl calls mixed mode ...
Steeve
21-Jan-2010
[1783]
OPEN, WRITE and CLOSE will be the only one usefull actors in my scheme
Graham
21-Jan-2010
[1784x2]
I think mine allows file upload resume by sening a APPE command with 
the rest of the file
but rather than handling it directly ... you can just write the command 
to the port
Steeve
21-Jan-2010
[1786]
a session will be something like:
>> session: open ftp://ftp.site.com
>> write session [
	USER "toto"
	PASS "****"
	PASV
	BINARY
	CD /dir-temp
	GET %thif-file
]
>> close session
Graham
21-Jan-2010
[1787]
ok, looking forward to seeing it ...
Steeve
21-Jan-2010
[1788x2]
and i will use a dialect to construct the state diagrams
for example, the state diagram used to open a ftp session looks like 
this currently.

USER
<< ( 
	(1 2) error
	(4 5) fail
	3 >> PASS << ( 
		2		success
		1		error
		(4 5)	fail
		3 >> ACCT << (
				2   	success
				(1 3) 	error
				4 5 	fail
		)
	)
)

it's a dialect
Graham
21-Jan-2010
[1790]
Nice ...  I'm looking for a dialected flow control GUI tool too :)
Steeve
21-Jan-2010
[1791]
This one, to rename a file:

RNFR ;** rename a file.
<< (
	(1 2) error
	(4 5) fail
	3 (
		>> RTNO
		<< (
			2	success
			(1 3)	error
			(4 5)	fail
		)
	)
)
Graham
24-Jan-2010
[1792x3]
I'm wondering how to interface with Amazon's simple DB.
Both Maarten and I passed the secret and access keys as parameters 
to the various functions, but I think I'd rather have a system/user 
object to store them and use them from there.
So, can we have an extensible system/user object that we can store 
user related data for use in schemes etc ?
BrianH
24-Jan-2010
[1795x5]
system/contexts/user is user-specific, and schemes can store their 
data in their modules if they like.
I don't think we're going to get back system/user - all global options 
are going under system/options, including options about users.
You need to make sure that your data is task-safe too, so changeable 
global options are usually bad unless they are changed through a 
function that synchronizes access. system/contexts/user is task-specific.
Don't know whether system/options will be task-specific - most of 
its options are supposed to be read-only.
The writeable options like binary-base are supposed to be moved to 
on-the-spot function options.
Graham
24-Jan-2010
[1800x2]
so, it's system/contexts/user/user ... we can store a user object 
here?
And set-net will store the data here too?
BrianH
24-Jan-2010
[1802x3]
system/contexts/user is the script context. You can put whatever 
script-accessible words you want there.
We are using modules and access functions like set-net instead of 
global options objects, for the most part.
The system structure of R3 is very different from R2.
Graham
24-Jan-2010
[1805]
I think we can work with everything being in system/contexts/user/user 
for the purposes of a scheme for the moment
BrianH
24-Jan-2010
[1806]
Remember that 'user is a common script word, so that will be overwritten. 
Use module-local data, or port-specific data.
Graham
24-Jan-2010
[1807]
Eh?
BrianH
24-Jan-2010
[1808]
Certainly, set-net shouldn't set anything writeable any other way.
Graham
24-Jan-2010
[1809]
Moving on .... an AWS:// scheme can certainly be derived from the 
http scheme
BrianH
24-Jan-2010
[1810x2]
system/contexts/user is the shared "global" context for all user 
scripts (not modules), and that's why it's task-specific.
Maarten did so for Qtask, so I assume that strategy for aws:// would 
work here.
Graham
24-Jan-2010
[1812]
Umm.. he rewrote the http scheme I think