2. “Hello“ Made Easy in REBOL!
REBOL[]
View Layout [
Title "Hello"
BTN "OK" [
Quit
]
]
3. Keep IT
Simple
REBOL is Simple!
1. Downloading & Upgrading
2. Installation
3. All In One, One For All
4. Coding
4. Porting to Other Platforms
5. Maintenance
4. When It Comes
to Programming,
Are You A
REBEL?[`rebl]
Stand up for Simplicity
and Flexibility, Against Software
Complexityand Software
Obesity, and Want to
Program with Fun.
Hay! You Got to Try Java
!!!
5. R E B O L
E
L
A
T
I
V
E
X
P
R
E
S
S
I
O
N
A
S
E
D
B
J
E
C
T
A
N
G
U
A
G
E
S T A N D S
F O R
6. As A Java Programmer,
You Know Objects Already.
16. Data Types You Can Imagine
datatype value
Int! 1
Decimal! 3.1416
Char! #"A"
Logic! True
String! "ABC"
>> ? 1
1 is an integer
>> ? 3.1416
3.1416 is a decimal
>> ? #"A"
#"A" is a char
>> ? True
TRUE is a logic of value: true
>> Type? "ABC"
== string!
17. Data Types You Cannot Imagine
datatypeURL value
Email! jerry@abc.com
Percent! 32%
Tag! <IMG>
Date! 2009-7-21
Time! 18:00
File! %gdi32.dll
Tuple! 127.0.0.1
URL! http://www.abc.com/
. . . More . . .
19. // Pseudo-Code
// Include This and That
// Declare This and That
// ...
Class MyApp {
MyApp () {
// …
}
void action() {
System.quit();
}
void layout() {
Label title = new Label("Hello")
Button btn = new Button("OK");
btn.Click = action;
Window win = new Window();
win.add(btn);
win.add(btn);
win.show();
}
}
REBOL[]
View Layout [
Title "Hello"
Btn "OK" [
Quit
]
]
The Magic
Of Dialects
27. REBOL/Code
• Talk to REBOL VM Directly
• With Great Performance
• REBOL Dialecting Technology
28. When to Use REBOL
Spider
Mobile
Agent
Instance
Messenger
Dialect
Artificial
Intelligence
Text
Processing
29. REBOL is COOL, REBOL is
GREAT, REBOL is
WONDERFUL, REBOL is ONE
of A KIND, REBOL is What I
Want …
30. Join Us
And
Do Something
REBOL User Group @ China
AliTalk Group: No. 16626148
Host: Jerry Tsai (KongXuan)
REBOL Docs Trans Program
(http://sites.google.com/site/cnrebol/)
Host: CaiMinKui
Rebology Blog
(http://rebollovesjerry.blogspot.com)
Host: Jerry Tsai
32. Q1: Print web page source
print read http://www.rebol.com
33. Q2: Open a GUI, read web page, sent
it as email
view layout [
u: field "user@rebol.com"
h: field "http://"
btn "Send" [
send to-email u/text
read to-url h/text
alert "Sent“
]
]
34. Q3: FTP upload all files
foreach file load %./ [
if not dir? file [
write/binary join
ftp://user:pass@example.com/ file
read/binary file
]
]
35. Q4: TCP port scanner
repeat n 100 [
if not error? try [
close open probe join tcp://localhost: n
] [
print [n "is open"]
]
]
36. Q5: Save web page text to a file
remove-each tag page:
load/markup http://www.rebol.com
[ tag? Tag ]
write %page.txt page
37. Q6: Digital Clock
view layout [
origin 0
t: h1 red black (to string! now/time)
rate 1
feel [
engage: [
t/text: now/time
show t
]
]
]