scala-var-keywordThis is even easier than for the val keyword (see “[cref scala-val-keyword-in-rebol]“):


var: :set

That’s all Folks :) Test for the absolute skeptics:


>> var 'a 1
== 1
>> a
== 1
>> a: 2
== 2
>>

Of course in Rebol this syntax is completely useless as you could just write:


a: 1

But for our Scala learning purpose this may help when reading similar syntax.

Update: my tweeter friend perekk suggested an even closer syntax:


var: func ['word [word!] value][
    set word value
]

so you can do without ‘ like this:


var number 1

Bookmark and Share