Jump to content

Enforced immutability: Difference between revisions

m
→‎{{header|Raku}}: Fix comments: Perl 6 --> Raku
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Raku}}: Fix comments: Perl 6 --> Raku)
Line 891:
=={{header|Raku}}==
(formerly Perl 6)
You can create constants in Perl 6Raku with <code>constant</code>:
<lang perl6>constant $pi = 3.14159;
constant $msg = "Hello World";
Line 918:
}</lang>
A number of built-in types are considered immutable value types, including:
<pre>Str Perl stringString (finite sequence of Unicode characters)
Int Perl integerInteger (allows Inf/NaN, arbitrary precision, etc.)
Num Perl numberNumber (approximate Real, generally via floating point)
Rat Perl rationalRational (exact Real, limited denominator)
FatRat Perl rationalRational (unlimited precision in both parts)
Complex Perl complexComplex number
Bool Perl booleanBoolean
Exception Perl exceptionException
Block Executable objects that have lexical scopes
Seq A list of values (can be generated lazily)
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.