[REBOL] Re: Confused about "word" forms
From: dhsunanda:gma:il at: 2-Dec-2010 20:39
> OK! I guess only :age will work in a function :)
>
> age and :age will both work at the core prompt.
I think Graham may mean something slightly different.
age1: 45
age2: func [] [return ask "how old are you"]
All these return the value associated with age1:
age1
== 45
:age1
== 45
get 'age1
== 45
But watch the difference with 'age2
age2
how old are you(escape) ;; ie executes the function
:age2 ;; appears to do nothing
get 'age2 ;; ditto
So try:
type? :age2
== function! ;;ah ha! it returns the function, rather than executes it
probe get 'age2 ;; ditto
func [][return ask "how old are you"]
See the difference?
Sunanda.