I wrote down what I learned so far, hope some beginners find it useful.  It's very 
incomplete, not bad for an unpaid beta tester, I think.  Also available at 
http://home.pacifier.com/~mcginty/rebol_fucked.html
------------------------

REBOL BEGINNERS TUTORIAL
EXECUTIVE SUMMARY: REBOL is the cocaine of scripting languages. I love it and I can't 
stop, yet at the same time I hate what it's done to me and the depths I've gone to to 
get more of it. It's so illegal you can't walk into a store and buy pharmaceutical 
grade documentation, I have to hustle for dregs of information at 2AM in the parking 
lot outside the trendiest BYOB. You can hear the beautiful people inside while you're 
homeless and trying to get past bouncer just to find out system/schemes/default/host.
Home 
Lessons Learned:
A. My bad: The expected procedure is read source code until you get it. There are no 
known tutorials except this one, which is why I decided to write it. You get a 
dictionary, users guide, users manual, the how-to, the faq and the archives at 
rebol.org. You'll be clicking the mouse button a lot if you want to read those. There 
are also a couple documents that mislead you about how easy it is to use rebol.
B The words:
word
function
value 
object
are used so interchangably, so vaguely, so often that they become meaningless. 
Anything can be anything in REBOL, except when it's not.

C. My bad: It is actually a good idea to start with Chapter 1. Values of the Users 
Guide

D: Rebol bad: There are two different documents, Users Guide and Users Manual. They 
are different, which isn't apparent at first. I suspect is is because the link called 
REVISED USERS MANUAL takes you to USERS GUIDE v2.2.0, while the link USERS GUIDE takes 
you to USERS GUIDE v2.1.2. Erin tells me the old guide is going away soon, which is a 
shame since it prints out in a fairly compact 46 pages. The User's Manual there is no 
way to print out unless you want to click the mouse button for hours at a time. I 
still haven't printed it. I'm up over 200 pages of paper now, all html pretty graphics 
that manages to squeeze two whole commands to a page. What ever happened to the flat 
ascii text file?

Well, you're not reading this to hear me bitch, on with the show.
REBOL 2.2.0.3.1, running on a Wintel 98 box.

E: PUNCTUATION (DON'T SKIP OVER THIS PART)
1. No punctuation = 
if data, get value 
>> system/user/email
== [EMAIL PROTECTED]
if function, do it
>> halt
>>
2. the colon
2.1 after = assign next characters to that word, like the LET statement
BASIC LET MADEUPWORD = 3
REBOL 
>> MADEUPWORD: 3
== 3
2.2 before = get value, but don't apply it. Kind of pointless for short examples.
>> madeupword
== 3
>> :madeupword
== 3
>>
2.3 the colon also shows up in protocols (file:) and the time data type.
3. ' = literal, much like quote marks in english, perhaps you want to print the word 
'delete instead of do the word delete.
>> 'delete
== delete
>> delete
** Script Error: delete expected target argument of type: file url.
** Where: delete
>>
4. ! = datatype model "DO this TO that"
used with MAKE and one of the datatype keywords. See below. Important.
5. Brackets [] like a parenthesis in math
6. Paranthesis () like [], but is evaluated immediately
7. "" double quotes = generally text
8. / = forward slash = a path evaluation
9. ; = semi colon = comment ; this is a comment
10. ^ = carat = used to insert ascii values
10. , = comma = unknown use used other than to seperate data entries
11. @ = unknown if used
12. \ = unknown if used
13. $ = unknown if used (outside the money datatype)
14. brit pound sterling sign = unknown if used

F: DATATYPE
The REBOL they start out with everything is a value, what they really mean is a 
datatype:
won't bother to define them:
integer! 
decimal!
time! 
date! 
money! 
logic! 
char! 
none! 
string! 
binary! 
email! 
file! 
url! 
issue! 
tuple! 
tag! 
block! 
hash! 
list! 
paren! 
path! 
words! 
REBOL DECIDES FOR YOU WHAT YOUR DATA TYPE IS!!!!
>> test: 123
== 123
>> type? test
== integer!
>> test: $123
== $123.00
>> type? test
== money!
>>
This is the kind of info that should be on the front page in bright red letters 
instead of on the back right after 'monosodium glutimate'.

G: KEYWORDS 
Which I define is a word you type at the prompt that does something. They seem kind of 
confused by this concept at REBOL. Depending on what docs you are reading, it means 
any or all of these things: a native, (built in functions), (internal language), 
(words with predefined values), (keywords), (keyword is a special purpose control 
symbol), (function that executes on the system processor), (predfined context) or what 
you find in (system/words).

or, they could mean short text strings of the sort often found in an english language 
dictionary returned to you by the kernel (system processor).

But the real thing is I want them sorted into functional groups, like every other 
tutorial in the universe. Here's my poor attempt so far.

Arithmetic operators: The familiar +,-,/* as well as many more. All also have english 
duplicates such as add, subtract etc.
Series specific functions: Rebol is very big on series, data entries inside of 
brackets.
next, back, pick, skip, tail, head, length?, index?, head?, tail?
find, select, sort, forall,foreach,forskip, match (2 series against each 
other),make,copychange,insert,remove,clear,none?,first,second,third,forth,fifth and 
last
evalutaion

contexting: haven't messed with this
use =

SCHEMES (protocols)
SMTP POP FTP HTTP NNTP FINGER

FUNCTIONS (KEYWORDS, whatever). The CONTEXT is the set of all defined words.
a function accepts "values" as "arguments" and return a "value" as a "result"
read = (reads from a) %file,...
write = (writes from a) %file,...
load = (analyze a value, determine its datatype, convert to that data type)
save = (convert and save in appropriate format for that datatype)
echo = to file and console >>echo %test.txt
trace = 
open =
close =
do =
insert =
reduce = [] evaluate all expressions in block as single expression
compose = 
input =
exists? =
delete = remove files
do [] = block evaluate

if = logic condition , block to evaluate if true
either = with two blocks
loop =
repeat =
break =
until = returns true
for = accidentally is same command as in BASIC
make = create an object, create new function
extend,use
try [] = attempt to do a function

LOGIC CONDITIONS
true, false, on, off, yes, no

General Nomenclature
1. A function comes before an argument ;prefix function
>> print 'this
this
>>
or
>> print 'one 'two 'three
one
== three
(maybe better not try that one)
2. Or else it comes between two arguments ;infix function
no example

H. THE WHOLE 'SYSTEM' THING
You'll quickly develop an adversarial relationship with the system processor, since it 
is completely undocumented and I think REBOL thinks you are crossing over into 
proprietary territory.
Anyway, I guess you talk to the system with functions
function (a series of values that exist temporarily)
and it talks back to you with objects
object (a series of values that exist defined permanent)
Which is different from a script evaluating, which is kind of like functions talking 
to each other, except when they need an object from the system processor.
Environmental variables (with a little help from [EMAIL PROTECTED])
REBOL calls these 'system objects' and you can find them by looking at a tree under 
system/
don't use the function source, or the function print, don't work
help works
Here's a quick look
>>help system/ = invalid path
>>help source/words = locks up rebol
>>help system = system is word of value: ?object?
>>help source/words = locks up rebol
>>help system/schemes = long dump of of good stuff
>>help system/options = short dump of good stuff
>>help system/user = short dump of name, email, and (functions defindined in user.r?)

There are others (system/network, system/version, system/product), but I don't really 
have time to type >>help system/a
through
>>help system/zzzzzzzz at this point. 
You'll probably want to dump these to a text file for study
>> echo %schemes.txt
>> help /system/schemes
>> echo none ; echo off and echo no don't work. That would be consistent logic, silly.
But what started me down this road was I wanted to find out environment variables like 
my home directory. I'll skip over the part in between. Just because I have suffered 
for my art it doesn't mean you have to:
(Note: Garbage is not my opinion of REBOL, I just have an old habit of keeping a 
directory called c:\garbage that I always put new files in to. If I go back later and 
don't remember what they are I'll assume I would have moved them out of that dir if 
they were important.
WHAT IS MY HOME DIRECTORY?
>> print system/options/home
/C/garbage/
>>
I WANT TO CHANGE THAT TO C:\TEMP
>> make object! [system/options/home: %/TEMP/]
>> print system/options/home
/TEMP/
>>
MISCELLANEOUS

There are a few good scripts out there that show you something about the system, 
you'll have to wade through all the ones that show you how to read email. huh.r is a 
good one. There's more I haven't looked at yet.
BOOTING
start rebol, it runs
rebol.r
user.r

------------------------------------------------------------
[EMAIL PROTECTED] for FREE ! http://www.CannabisMail.com
Wanna advertise here ? http://www.CannabisMail.com/sponsor.htm

Reply via email to