Compound data type
Array
my @point = 3, 8;
my Int @point = 3, 8; # or constrain to integer elements
Hash
my %point = x => 3, y => 8;
my Int %point = x => 3, y => 8; # or constrain the hash to have integer values
Class instance
class Point { has Real ($.x, $.y) is rw; }
my Point $point .= new: x => 3, y => 8;
my $s1 = set <a b c d>; # order is not preserved
my $s2 = set <c d e f>;
say $s1 (&) $s2; # OUTPUT«set(c, e)»
say $s1 ∩ $s2; # we also do Unicode
PreviousComposite numbers k with no single digit factors whose factors are all substrings of kNextConcatenate two primes is also prime
Last updated
Was this helpful?