Compound data type: Difference between revisions
Content added Content deleted
(→Class instance: minor simplifications, + type constraint) |
|||
Line 2,286: | Line 2,286: | ||
===Class instance=== |
===Class instance=== |
||
<syntaxhighlight lang="raku" line>class Point { has $.x |
<syntaxhighlight lang="raku" line>class Point { has Real ($.x, $.y) is rw; } |
||
my Point $point .= new |
my Point $point .= new: x => 3, y => 8;</syntaxhighlight> |
||
===[http://design.raku.org/S32/Containers.html#Set Set]=== |
===[http://design.raku.org/S32/Containers.html#Set Set]=== |