Yes, it sometimes confuses beginners mind but actually it is a nice = feature. Below example shows that feature very nice. It uses "count: [0]" instead of "count: 0" which is completly different.
> -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf > Of Tim Johnson > Sent: Wednesday, April 29, 2009 1:56 AM > To: [email protected] > Subject: [REBOL] Re: setting values to blocks - need help >=20 >=20 > On Tuesday 28 April 2009, Tim Johnson wrote: >=20 > > And that is not a bad thing, once you get used to it. For > instance, if > > you were to assign a series value to a word in a function, rather > than > > 'copy'ing the value to the word, the word then retains its value, > for > > subsequent calls to that function. Like a static datatype in C. > > Can be useful at times. > Sorry - left out an example. > Example below: > test: func[/local res][ > count: [0] > count/1: count/1 + 1 > print rejoin["this function has been called " count/1 " times"] > ] > >> loop 6[test] > this function has been called 1 times > this function has been called 2 times > this function has been called 3 times > this function has been called 4 times > this function has been called 5 times > this function has been called 6 times >=20 > ;; HTH tim >=20 >=20 > -- > To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject. -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
