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

World: r3wp

[!REBOL3 Schemes] Implementors guide

Graham
14-Jan-2010
[1395x2]
Great progress ... was able to submit a fax using my new fax:// protocol.
The fax protocol is similar to ftp but uses port 4559, and uses additional 
commands
Andreas
14-Jan-2010
[1397x3]
basic IMAP4 is not much more difficult than POP3
bittorrent would be interesting indeed, as you can easily get _tons_ 
of network activity wh
which would be nice to exercise the R3 networking stack
Gregg
14-Jan-2010
[1400]
Graham, Andreas, Steeve, et al, this is great stuff you're doing. 
Thanks for your efforts.
Andreas
14-Jan-2010
[1401x3]
well, now onto the final pop3 rewrite
i've finally come up with a clean (imho) low-level interface:
mbox: open pop3://
until [empty? msg: read mbox]
close mbox
i.e. read on the pop3 port iterates thru all available messages, 
returning an empty series after the last message was read
Steeve
14-Jan-2010
[1404x2]
Andreas, normaly it's the behavior of COPY to iterate thru a port 
result
i mean it is like that in R2
Gregg
14-Jan-2010
[1406x2]
So 'msg is returned as a block?
I was thinking of that too Steeve. COPY versus READ versus TAKE.
Steeve
14-Jan-2010
[1408]
Nice idea Gregg, READ could return the whole block (an COPY  or TAKE 
just one line at time)
Gregg
14-Jan-2010
[1409]
In this case, READ seems OK, and COPY would work as well, but not 
delete the mail on the server.
Andreas
14-Jan-2010
[1410]
read returns a binary!
Steeve
14-Jan-2010
[1411]
bu you could return a block if you wish ;-)
Gregg
14-Jan-2010
[1412]
Ah, so this is a native READ, not a wrapper in your scheme. Got it.
Andreas
14-Jan-2010
[1413x2]
i could return all messages in a block, yes
i think i got the idea of READ iterating from some R3 example
Steeve
14-Jan-2010
[1415]
Andreas, where is your source, is that free ?
Gregg
14-Jan-2010
[1416]
Then we need a callback mechanism for progress, if we read all in 
one shot.
Andreas
14-Jan-2010
[1417x3]
http://bolka.at/share/prot-pop3.r
[temporary url]
not yet licensed
Steeve
14-Jan-2010
[1420]
not need of a callback, you can return a block and populate the same 
block further.
You see what i mean ?
Andreas
14-Jan-2010
[1421]
interesting idea
Gregg
14-Jan-2010
[1422]
I'd like to see it stay low level in the scheme, as Andreas has it, 
and add wrappers for higher level operations.
Steeve
14-Jan-2010
[1423]
yep, i think so
Andreas
14-Jan-2010
[1424x3]
we can add a series protocol later on
the source avail at http://bolka.at/share/prot-pop3.rcurrently still 
has a series interface
length? for getting the num of messages avail, pick for reading a 
specific message
Gregg
14-Jan-2010
[1427]
I think I understand Steeve, but then how does your calling code 
know the block has been extended, without polling?
Steeve
14-Jan-2010
[1428x2]
and read for the whole block (which can be updated)
Greeg, i think we could add some info in the block, like a timestamp 
at the head
Andreas
14-Jan-2010
[1430]
hm, that'll get messy soon
Steeve
14-Jan-2010
[1431]
perhaps it's better to return an structured object
Gregg
14-Jan-2010
[1432]
The ability to get just headers, number of messages, etc. is great. 
Get a little info, show the user, request more data as desired, and 
show progress for lengthy ops.
Andreas
14-Jan-2010
[1433x2]
progress for length ops still is an open problem
i could enable copy/part for downloading large messages
Gregg
14-Jan-2010
[1435x2]
Still, without a callback or notification of some kind, the caller 
has to poll against the block to check for changes.
Having the basics first is great Andreas.
Andreas
14-Jan-2010
[1437x3]
ah, i know where i got the idea from. the large file copy example 
on the "docbase" wiki
http://www.rebol.net/wiki/Port_Examples#Copy_a_large_file
ha! read/part :)
Steeve
14-Jan-2010
[1440]
Andreas, your binding in the awake function should ne done only one 
time, at construction
Andreas
14-Jan-2010
[1441]
sure. but forget that code, i'll put up something more up-to-date 
soon
Gregg
14-Jan-2010
[1442x2]
Yes, I think that should work. Then your state machine will need 
to know it's building a message, or loop internally.
All the recent scheme work makes me want to jump in and see if we 
can make a nice scheme dialect. :-)
Steeve
14-Jan-2010
[1444]
Agree