[REBOL] Re: On mutability and sameness
From: sanghabum:aol at: 6-Jun-2001 5:05
Hi Ladislav,
> I am pretty sure, that the feature you are describing is not a bug. The
> reason for the behaviour is pretty simple. Rebol values of type TUPLE!
DATE!
> INTEGER! and some other types are immutable - Mark Dickson uses the word
> constant to express the same feature. What does the strange word mean? No
> Rebol function can change these values. Example:
<snip>
Bug, feature, or quirk --- any of them are acceptable. But if it is a feature
(and if it is, it's a fairly fundamental one), it would help if the
documentation mentioned it. The users' guide's simply says there are two
fundamental datatypes: scalars and series. We now seem to be discovering each
of these can be mutable or immutable.
That leaves me with a much more complex model of what is going on. Add in the
fact that Poke will operate on a two-part item like Money!, but not on a
two-part item like Pair! and some of the dazzling simplicity starts to slip
away....I now have to remember to use Poke in two different ways:
Poke MyBlock 2 5 ;;--to update a Block
MyTuple: poke MyTuple 2 5 ;; -- to update a Tuple
Plus, I can't use it at all on a Pair, so I need to write:
Mypair/2: 5 ;;-- to update a Pair
Thanks for the analysis,
--Colin.