Enforced immutability: Difference between revisions

Content added Content deleted
No edit summary
Line 4: Line 4:
Demonstrate any means your language has to prevent the modification of values, or to create objects that cannot be modified after they have been created.
Demonstrate any means your language has to prevent the modification of values, or to create objects that cannot be modified after they have been created.
<br><br>
<br><br>

=={{header|11l}}==

Prepend V/var keyword with minus sign to make variable immutable:
<lang 11l>-V min_size = 10</lang>

=={{header|6502 Assembly}}==
=={{header|6502 Assembly}}==
Most assemblers allow you to define labels which can refer to constant values for clarity.
Most assemblers allow you to define labels which can refer to constant values for clarity.
Line 25: Line 31:


The CPU isn't aware that these labels exist, however, as the assembler automatically replaces them with the assigned value.
The CPU isn't aware that these labels exist, however, as the assembler automatically replaces them with the assigned value.

=={{header|11l}}==

Prepend V/var keyword with minus sign to make variable immutable:
<lang 11l>-V min_size = 10</lang>


=={{header|8th}}==
=={{header|8th}}==