World: r3wp
[!REBOL3 Schemes] Implementors guide
older newer | first last |
Henrik 12-Aug-2010 [2112] | Robert made an overview of how ports work a while ago. I'm not sure if it's available publicly. |
Graham 12-Aug-2010 [2113] | file io is sync isn't it? |
Pavel 12-Aug-2010 [2114x2] | Thats what I wrote |
But ok sub port cannot be unleashed from above schema right? | |
Graham 12-Aug-2010 [2116x2] | why not? |
the main port is just an abstraction .. to allow you to work on the real port | |
Pavel 12-Aug-2010 [2118] | Thats what I ask, may the scheme be asynchronous when low level port is synronous and we dont use tasks yet? |
Graham 12-Aug-2010 [2119] | I don't think so |
Maxim 12-Aug-2010 [2120x2] | I guess we'll need device extensions for briging the gap. |
briging = bridging | |
Pavel 12-Aug-2010 [2122] | Has anybody tried some file related scheme? zip// or somethink like was in disscussion? |
Graham 12-Aug-2010 [2123] | I'm missing what is the point? the network schemes are written to try and emulate file io ... |
Maxim 12-Aug-2010 [2124] | access to RIF? |
Pavel 12-Aug-2010 [2125] | Graham I like to write a scheme for my mini RIF implementation yes maxim |
Maxim 12-Aug-2010 [2126] | direct DB table access using read/write would be VERY powerfull :-) |
Pavel 12-Aug-2010 [2127] | Ie write number to port get record back, write record to port get number back for the very beginning |
Andreas 12-Aug-2010 [2128x2] | make-scheme [ name: 'foo title: "FOO Protocol" spec: make system/standard/port-spec-head [] actor: [ open: func [port [port!]] [ print 'open make-scheme [ name: 'foo title: "FOO Protocol" spec: make system/standard/port-spec-head [] actor: [ open: func [port [port!]] [ print 'open ] read: func [port [port!]] [ print 'read ] ] ] f: open foo://bar.baz read f |
hmm, ignore the first duplicate part of the paste | |
Pavel 12-Aug-2010 [2130] | good andreas muchas gracias you know I'm a beginner |
Graham 12-Aug-2010 [2131] | There's a typo there .. FOO should be RIF :) |
Pavel 12-Aug-2010 [2132x2] | should a file to be implemented into read for real reading? (how to) |
into read actor | |
Andreas 12-Aug-2010 [2134x2] | yes. you can just use normal READ to read from a file within the read actor |
if you want to keep a file open, you can keep port-local state in port/state | |
Pavel 12-Aug-2010 [2136x2] | OK thanks I'll try my own, anyway is there any distinction if fileport is open/closed? after close the information is still open |
ie port looks the same open or closed and open? returns true, more the port cannot be deleted/removed currious | |
Graham 12-Aug-2010 [2138] | What's the current state of RIF? |
Andreas 12-Aug-2010 [2139x2] | CLOSE on a foo port will be a no-op, unless you implement a close actor. |
Same for OPEN?. | |
Pavel 12-Aug-2010 [2141x2] | graham I've commented it in DB chat , to be honest I thin Carl would do it better but I cannot wait more |
andreas missunderstanding when f: open %file close f open? f returns true | |
Graham 12-Aug-2010 [2143] | we can't wait for Carl to do everything .. just have to be prepared to discard our work if he rewrites it! |
Pavel 12-Aug-2010 [2144] | exact |
Graham 12-Aug-2010 [2145] | you'd write your own 'open? actor |
Pavel 12-Aug-2010 [2146x2] | only for open more files at once |
my RIF needs to work with double files simoutaneously | |
Andreas 12-Aug-2010 [2148] | Pavel, not for me: >> f: open %.vimrc >> open? f == true >> close f >> open? f == false |
Pavel 12-Aug-2010 [2149x3] | I'll check it |
you are right but then f cannot be unset (removed) but I can live with it | |
andreas your open wont do its job I'm sorry | |
Steeve 13-Aug-2010 [2152] | Check this http://sites.google.com/site/rebolish/Home/idx.r |
Pavel 13-Aug-2010 [2153] | thanks steve for inspiration, may I know why you use actor* and not regular actor? |
Steeve 13-Aug-2010 [2154] | several reasons |
Pavel 13-Aug-2010 [2155] | Anyway I'm partially succesfull with rif:// scheme, I can open multiople files from port: open rif://data/file, I can close multi files with clos port, I can write port to-binary "some record". What is difficult is to pass argument (number of wanted record) to read actor. it seems read acor accept only port. Any hint? |
Steeve 13-Aug-2010 [2156x2] | I use copy and copy/part to real several records |
I don't use read as actor because of that | |
Pavel 13-Aug-2010 [2158x2] | It is only different name of function or has it some deeper reason? (read malfunction?) |
Inside is read/seek/part used of course | |
Steeve 13-Aug-2010 [2160] | deeper reason, you can't add refinement to existing functions (overlapped as actors). I just think copy is more suited to do so (because of /part) |
Pavel 13-Aug-2010 [2161] | For RIF more suitable names would be PUT/GET as in basic key-value stores (memcache f.e.) I can try this convention |
older newer | first last |