Hi Peter,

Thanks for the extra information. No, I didn't know all this already
:-) I'm pretty happy to see that the handling of variables and types is
 similar to other dynamic languages that are already lodged into my
brain, especially Ruby. Means less for me to worry about :-)

Kind Regards,

Brian Wisti
http://coolnamehere.com/

--- PeterWAWood <[EMAIL PROTECTED]> wrote:

> 
> Hi Brian
> 
> A couple of points relating to datatypes and variables that aren't
> clear
> from your notes. This is my understanding as a fellow Rebol learner.
> I'm
> sure that the many wise Rebolers will chip in and correct my
> mistakes.
> 
> 1. Everything is a value in Rebol. Values have datatypes.
> 
> >> type? 1
> == integer!
> 
> type? now
> == date!
> 
> >> type? /time
> == refinement!
> 
> >> type? now/time
> == time!
> 
> 2. Rebol infers the datatype of a value from its format
> 
> >> type? 12.34.56.78
> == tuple!
> 
> >> type? http://www.bbc.co.uk
> == url!
> 
> 3. Rebol simply evaluates the values in the order it is presented
> with them,
> normally a line at a time (though blocks enclosed in [] can extend
> over a
> line). Each datatype has it's own evaluation rules.
> 
> >> 1
> == 1
> 
> >> now
> == 27-Dec-2004/14:04:40+8:00
> 
> >> now/time
> == 14:04:14
> 
> >> [big bigger biggest]
> == [big bigger biggest]
> 
> 4. In console mode, Rebol returns the last value it evaluated :
> 
> >> 1 2 3 4 5 6
> == 6
> 
> >> now/time 5
> == 5
> 
> 5. There are no variables in Rebol. Rebol has the datatype word. A
> word
> stores the "address" of a value. When Rebol evaluates a word, it
> actually
> evaluates the value "pointed" to by the word. 
> 
> >> soup-of-the-day
> == "minestrone"
> 
> Even before passing a word to the type? function which returns the
> datatype
> of a value, Rebol evaluates the word as the underlying value
> "pointed" to by
> the word.
> 
> >> type? soup-of-the-day
> == string!
> 
> Sometimes you don't want Rebol to evaluate a word but want to refer
> to the
> word itself. This is done by putting a ' in front of the word. This
> is
> referred to as a literal word or lit-word in Rebol.
> 
> >> type? 'soup-of-the-day
> == word!
> 
> A word is "connected" to value by using the set function :
> 
> >> set 'soup-of-the-day "minestrone"
> == "minestrone"
> 
> or its shorter form, known as a set-word:
> 
> >> soup-of-the-day: "oxtail"
> == "oxtail"
> 
> Words can be pointed at any type of value including other words,
> blocks,
> functions, ports, schemes and so on.
> 
> One of the Rebol learners mistakes that I often make is to expect a
> word to
> always point to a value of a certain type. In most programming
> languages the
> datatype is associated with the variable (eg int i), but in Rebol the
> datatype is associated with the value not the word that points to it.
> 
> Here is an example :
> 
> >> string: "12345"
> == "12345"
> >> type? string
> == string!
> >> string: find string "a"
> == none
> >> type? string
> == none!
> 
> But you probably knew all of this already.
> 
> Happy Reboling
> 
> Peter
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of
> Brian Wisti
> Sent: 26 December 2004 17:21
> To: Rebolist
> Subject: [REBOL] A little bit of Rebol content
> 
> 
> Hi all,
> 
> Part of my learning experiences involve scribbling down notes and
> putting
> them on my website in hopes that they'll be useful to someone else.
> So
> here's my attempts at writing down my learning of Rebol:
> 
>    - http://coolnamehere.com/geekery/rebol/learn/part01.html
>    - http://coolnamehere.com/geekery/rebol/datatypes.html
> 
> Please take a look and let me know what you think!
> 
> Kind Regards,
> 
> Brian Wisti
> http://coolnamehere.com/
> 
> 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.296 / Virus Database: 265.6.4 - Release Date: 22/12/2004
>  
> 
> -- 
> To unsubscribe from the list, just send an email to rebol-request
> at rebol.com with unsubscribe as the subject.
> 
> 

-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to