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

World: r3wp

[!REBOL3-OLD1]

Steeve
11-Jan-2010
[20611]
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
[20651x2]
Rebolek - then switch should be supplied a reduced block :-)
We are not talking about block here, but a function body. And if 
I write switch type? %user.r [file! [print "... a file"]] ... it 
is imo supposed to work ...
Rebolek
11-Jan-2010
[20653]
...switch should be supplied a reduced block

no, that's wrong. See:

>> a: 1
== 1
>> switch 'a [a ["ok"]]
== "ok"


>> switch 'a reduce [a ["ok"]]

== none
WuJian
11-Jan-2010
[20654]
>> a: 1
== 1
>> switch a reduce [a ["ok"]]
== "ok"
Pekr
11-Jan-2010
[20655]
how is novice supposed to know, that actually submitting result of 
type? %user.r is not going to work with file! datatype in a switch 
body?
sqlab
11-Jan-2010
[20656]
no need for reducing
  type? first [#[datatype! file!]]
Rebolek
11-Jan-2010
[20657x2]
By reading manual probably
file! in the switch body is not datatype! but word! Understanding 
this will help to better understand how REBOL works.
Steeve
11-Jan-2010
[20659]
Pekr, an old Reboler like you...
Rebolek
11-Jan-2010
[20660]
:)