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

World: r3wp

[!REBOL3-OLD1]

Graham
11-Jan-2010
[20602]
read/as ftp://ftp.rebol.com/matrix.avi[ file: %movies/matrix.avi 
]

and to resume


read/ask/seek ftp://ftp.rebol.com/matrix.avi[ file: %movies/matrix.avi 
 ] current-file-size-of-matrix.avi
Pekr
11-Jan-2010
[20603]
hmm, but /as was proposed to specify just type of encoding IIRC, 
not some other functionality ... some of us wanted /as being more 
general, allowing you to specify a codec to decode. Codecs are so 
far inefficient (not streamed), because you have to read all data 
firts, then pass it to encode/decode.

Carl never posted a resolution to read/write case ....
Graham
11-Jan-2010
[20604x2]
Need some way to pass parameters to scheme actors.  Andreas is using 
read/lines !
I think my schemes are making R3 unstable.  Tried to post a message 
and got from chat


rebol system error #1301: invalid datatype 99 ... should never happen 
...
Steeve
11-Jan-2010
[20606]
Well, we don't need of specific refinements, cause we can pass a 
block to read (which is converted to a port!).

>> read [scheme: 'ftp host: ... path:... other_data: ....]


The  block format could be used to pass other parameters in a more 
handy way.


>> read [ftp://ftp.rebol.com/matrix.avifile: %movies/matrix.avi]


And the good news, is that it's absolulty possible to have something 
like that now.
We just have to patch the function: system/intrinsic/make-port
Pekr
11-Jan-2010
[20607x2]
Steeve - it is good we have you here :-)
btw - some time ago someone stated here, that current https scheme 
is done "old school". Was that you? Isn't now the right time to define 
the better way (if any) to aproach schemes and networking? :-)
Graham
11-Jan-2010
[20609]
Well, I am using a write spec block ...
Steeve
11-Jan-2010
[20610x2]
sorry again (it's true i said this)
easy to talk hard to do
Graham
11-Jan-2010
[20612x2]
Steeve .. don't waste your time on a r2 chat .. there's no traffic 
on there.  Spend your time on schemes :)
We need a place to set a system timeout ...
Steeve
11-Jan-2010
[20614x2]
To my mind, we need a better framework to design shames using a FSM 
dialect
shames=schemes
Graham
11-Jan-2010
[20616]
Like uniserve?
Steeve
11-Jan-2010
[20617x2]
;-)
uniserve has some good ideas
Graham
11-Jan-2010
[20619]
Or do you mean use a dialect to define the scheme?
Steeve
11-Jan-2010
[20620]
yes a dialect to construct schemes
Graham
11-Jan-2010
[20621]
meta programming
Steeve
11-Jan-2010
[20622]
Rebol is especially good with those things
Pekr
11-Jan-2010
[20623]
someone did FSM in the past. Gregg? Henrik?
Graham
11-Jan-2010
[20624]
Gregg
Pekr
11-Jan-2010
[20625]
One from gabriele - http://www.colellachiara.com/soft/Misc/qml/fsm.rlp
Henrik
11-Jan-2010
[20626]
Ladislav has done one too. Time for a FSM battle?
Graham
11-Jan-2010
[20627]
I suspect that you have to write a few schemes to see what is needed 
and then write the scheme dialect
Steeve
11-Jan-2010
[20628]
yup we should start with the html one in R3, it's a huge one currently
Pekr
11-Jan-2010
[20629]
Here's related ML discussion - http://www.rebol.org/ml-display-thread.r?m=rmlFDMJ
Graham
11-Jan-2010
[20630]
http://www.rebol.com/r3/docs/functions/write.html


says there is a /binary refinement .. but this doesn't exist any 
more
Gabriele
11-Jan-2010
[20631x3]
Graham, I'd do what you want with:
pipe ftp://somehost/somefile%/path/to/somefile
my implementation of PIPE is only a few lines. i think it should 
be native to R3.
Graham
11-Jan-2010
[20634x4]
my lower level is working like this

write port [ RETR "bigfile" %bigfile ]
how does switch on type? work?
switch type? %test.r [ .... ]

what do I need to write in the block to catch it ?
Gab, you should pipe up with the source to pipe :)
Rebolek
11-Jan-2010
[20638]
Graham:
>> switch type?/word 1 [integer! [print "ahoj"]]
== ahoj
Pekr
11-Jan-2010
[20639x2]
Graham, weird, but you can try:

>> switch to-word type? %test.r [file! [print "... a file"]]
... a file
so return of 'type? is not a type? Well, we have not a datatype type? 
Yes, we have - datatype! .... but help reveals you can't do "to-datatype" 
...
Rebolek
11-Jan-2010
[20641]
Also this works:

>> switch type? 1 reduce [integer! [print "ahoj"]]
== 
ahoj
Steeve
11-Jan-2010
[20642]
type?/word is here for that
Rebolek
11-Jan-2010
[20643x2]
Pekr, return of type? is datatype!! but the datatype in the switch 
block is just word!, not datatype! .
So you need word! from type! or reduce the seitch block to get datatype! 
instead of word! .
Pekr
11-Jan-2010
[20645x2]
why is datatype a word? :-)
Hmm, you are right:

>> type? file!
== datatype!

>> type? first [file!]
== word!
Rebolek
11-Jan-2010
[20647x3]
because the block is not evaulated
>> type? first reduce [word!]

== datatype!
It may look confusing, but it makes perfect sense, it same as:

>> a: 1                 

== 1


>> type? first [a]       

== word!

>> type? first reduce [a]
== integer!
PeterWood
11-Jan-2010
[20650]
Graham: Binary is the default for read & write in R3. The documentation 
doesn't seem to have been fully updated for R3 yet,
Pekr
11-Jan-2010
[20651]
Rebolek - then switch should be supplied a reduced block :-)