Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: A few questions about words

From: christian::ensel::gmx::de at: 19-Oct-2000 20:06

Hi Eric, look at the following console session:
>> word1: "initial value"
== "initial value"
>> set 'word1 "new value"
== "new value"
>> word1
== "new value"
>> word2: 'word1
== word1
>> set word2 "even newer value"
== "even newer value"
>> word1
== "even newer value" The above makes use of the fact that SET expects a LIT-WORD! to determine which word it should assign the value to.
> If I am completly off the mark on this one let me know.
You're not ;-) Look at
>> f1: func ['word] [print ["Function was called on word" word]] >> ; ^^^^^ >> f1 some-word
Function was called on word some-word
>> f1 'some-word
Function was called on word some-word
>> f2: func [word] [print ["Function was called on" word]] >> ; ^^^^ >> f2 some-word
** Script Error: some-word has no value. ** Where: f2 some-word
>> f2 'some-word
Function was called on word some-word Regards Christian [Christian--Ensel--GMX--De]