Mutable/immutable Rebol values.

Adding a correction and examples how you can change the state of
mutables.

The relations:

mutable <=> series
immutable <=> scalar

are pure coincidence, because you can have immutable series and
mutable scalars. It is simply a matter of preferences of the
implementor. You can see it looking at action/native/op - all of
them contain some series - arg descriptions, yet they are
immutable. If Rebol Tech. decide, that for the function F first :f
second :f and third :f shall return deep copies of the respective
blocks, then some functions will be immutable as a consequence.
(and that is not the only way how to make some functions
immutable).

Mutable are the Rebol values, that can change their
state. (more like a storage than like a value in a sense)

Immutable are the Rebol values that cannot change their state.
(really
values in a sense)

> any-type ; undecidable
>     any-function ; undecidable
>         action ; immutable
>         function ; mutable (change first ...)
>         native ; immutable
>         op ; immutable
>     any-word ; mutable (bind ...)
>         get-word ; mutable (bind ...)
>         lit-word ; mutable (bind ...)
>         refinement ; mutable (bind ...)
>         set-word ; mutable (bind ...)
>         word ; mutable (bind ...)
>     bitset ; immutable
>     char ; immutable - scalar
>     date ; immutable - scalar
>     error ; mutable (disarm ...)
>     logic ; immutable - scalar
>     money ; immutable - scalar
>     none ; immutable - scalar
>     number ; immutable
>         integer ; immutable - scalar
>         decimal ; immutable - scalar
>     object ; mutable (a/x: ...)
>     port ; mutable (close ...)
>     series ; undecidable
>         any-block ; undecidable - corrected
>             block ; mutable - series (change ...)
>             list ; mutable - series (change ...)
>             lit-path ; immutable
>             hash ; mutable  - series (change ...)
>             paren ; mutable - series (change ...)
>             path ; immutable - series
>             set-path ; immutable
>         any-string ; mutable (change ...)
>             binary ; mutable - series (change ...)
>             email ; mutable - series (change ...)
>             file ; mutable - series (change ...)
>             issue ; mutable - series (change ...)
>             string ; mutable - series (change ...)
>             tag ; mutable - series (change ...)
>             url ; mutable - series (change ...)
>     symbol ; immutable
>     time ; immutable - scalar
>     tuple ; immutable - scalar
>     unset ; immutable

Reply via email to