AltME: Rebol School

Messages

GrahamC
the rebol3 protocol might give you more things you can do.

Reichart
I decided to post this here, since this is the closest topic.
Ever lose your glasses (and they are on your head), or lose your car keys (and they are in the door)?
Many many years ago I wrote a REBOL program that was self modifying.  It also checked to see if it could run, and revert and tell you what went wrong.
I do have a copy of this, but I don't have access to my head or door knob, er, I mean I don't have access to the harddrive (which is in a safe in another state) right now.
I'm hoping someone here has a copy of my old program, I want to show it to a friend I'm teaching REBOL to.

Gregg
I'm pretty sure I don't have it.
Maxim
I've never seen it.
PeterWood
You asked the same quesiton on 26th Jan 2012 on the REBOL3 World.
PeterWood
Endo
I nevet heard of it, but looks cool.

Reichart
Peter, yup, sometimes asking more than once gets a result, never know.
I know where I have a copy of it, but I have to dig into a safe and then pull some old drives out.

Endo
Just for the record: I've added Turkish chars support in pdf-maker.r (Gabriele's script),
I downloaded www.opensource.apple.com/source/vim/vim-44/runtime/print/cp1254.ps file and added Turkish chars from there to
/Differences [...]
If anyone need more info you can write me PM.

Arnold
Can a header be combined for a Red and a REBOL script:
Red [
REBOL[] ;] ; would this work??
Oldes
I don't think so, but this could:
REBOL [] Red [] print "hello"
(not tested)
Maxim
rebol ignores everything preceding the REBOL [  ]   for sure... in theory, Red should be doing the same thing.

Marco
Maxim
just for the record though, only one language at a time can load that script.   (you need to comment out the language you want to use )
Bo
Actually not.  This works in Rebol or Red:
RED []
rebol: none
REBOL []
print "This is a test"

Arnold
Thank you Bo! Very clever. Just to be sure use Red [] and not RED []

Reichart
What is the smallest simplest example script for "port" .  
Hopefully something that shows off how easy it is to connect two computers and send information back and forth.  Perhaps a file.  Although a message system is ok too of course.
Gregg
Something like this? Run once as server, then again as client.
role: ask "Run as [C]lient or [S]erver? "
; Server
if role = "s" [
    port: tcp://:9090
    server: open/direct/no-wait port
    wait server
    client: first server
    print "Client connected."
    forever [
        wait any [client .01]
        if msg: copy client [
            print [now/precise msg]
            insert client "pong"
        ]
    ]        
]
; Client
if role = "c" [
    port: tcp://127.0.0.1:9090
    server: open/direct/no-wait port
    forever [
        insert server "ping"
        if msg: copy server [
            print [now/precise msg]
        ]
        wait .1
    ]
]
halt
Or there are slightly more involved examples out there. Like http://www.rebol.net/cookbook/recipes/0028.html
The WAITs in mine aren't needed, just there to slow things down a bit for human consumption.

Last message posted 184 weeks ago.