[REBOL] Re: Confused about "word" forms
by Sunanda
 |
REPLY TO AUTHOR
|
 |
|
|
 |
REPLY TO GROUP
|
 |
|
> 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.
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.
Bookmark with:
Delicious
Digg
reddit
Facebook
StumbleUpon
Related Messages
opensubscriber is not affiliated with the authors of this message nor responsible for its content.
|