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

World: r3wp

[!REBOL3 Schemes] Implementors guide

Pekr
20-Jan-2010
[1729]
Anyway - good to know, there is still some secret mode to reveal 
:-) So maybe one day Carl describes how to utilise two separate buffers 
:-)
Graham
20-Jan-2010
[1730]
I think it would be good if people actually tested the schemes!
Pekr
20-Jan-2010
[1731]
OK, I will do few tests with my FTP Linux server, during the evening 
...
Graham
20-Jan-2010
[1732x4]
It would be good to get these all tested and written to a usable 
level while the code is still fresh, and while the spirit is willing 
...
Of course, Carl's code review may change all of that ...
With the latest code I got an error before the lookup event connecting 
to imap.aim.com and then it was ok.  Odd.
got an error event before the lookup event
Pekr
20-Jan-2010
[1736]
Carl is going to review the code? What's going to be the outcome? 
Full rewrite? Or just some methodology/aproach suggestions?
Rebolek
20-Jan-2010
[1737]
I think that depends on the review :)
Graham
20-Jan-2010
[1738]
Right, that was the plan ..to get Carl to review schemes and advise 
on a "best" practice.
Maxim
20-Jan-2010
[1739]
Carl is usually responsive when you give him something to look at.


if all he has to do is direct users into improving code, his intellect 
is much more usefull than if he is occupied hammering code out and 
sifting thru tedious RFCs.
Graham
20-Jan-2010
[1740x2]
I've got this in my network code ..

			;find/part msg join generator " OK" 8
			join generator " OK" = copy/part msg 8


and can't figure out why the first line does not work but the second 
does ....
Somewhere I came across a document that showed how 'open, 'read etc 
would search the schemes to invoke the correct actor.  Anyone know 
the link?
Steeve
21-Jan-2010
[1742x2]
weird, I thought exactly the opposite. Why the second case is working 
?
Should be:
(join generator " OK") = copy/part msg 8
For the firt case, i'd rather prefer.
>> find/match msg join generator " OK"
Graham
21-Jan-2010
[1744x3]
hmm.. I didn't need the ( )
I use find/part because I want to match at the start of the line
of the series
Steeve
21-Jan-2010
[1747]
Then, use find/match

But using Parse is better to my mind (less memory overhead)
>> parse msg [generator " OK" to end]
Graham
21-Jan-2010
[1748x2]
True ... but still there's a bug in find/part
Isn't there some new way to return true from parse without the "to 
end" now?
Steeve
21-Jan-2010
[1750]
(break/return true) but i don't know if it's faster
Graham
21-Jan-2010
[1751]
Yeah .. that's what I was thinking of
Steeve
21-Jan-2010
[1752x2]
but you must have a loop
>> loop 1 [parse msg [generator " OK" (break/return true)]]
Graham
21-Jan-2010
[1754]
compose [ (generator)  ...
Steeve
21-Jan-2010
[1755]
with a sub-rule...
>> match: [(break/return true)]
>> loop 1 [parse msg [generator " OK" match]]
Graham
21-Jan-2010
[1756]
why the parens in your sub rule?
Steeve
21-Jan-2010
[1757]
because break is not a part of the parse dialect.
It's a regular function
Graham
21-Jan-2010
[1758x2]
ahh... not thinking
just looking ... break does appear in the new parse dialect
Steeve
21-Jan-2010
[1760]
but not break/return
BrianH
21-Jan-2010
[1761]
And in the R2 parse dialect, but the meaning in both cases is different 
from the function.
Graham
21-Jan-2010
[1762x2]
brianh, what's causing the find/part error?
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
		]
]