Show index while looping (enumerate)
my @aa = 8 .. 12;
for @aa.kv -> $i, $_ { say "$i: $_" }
my $1 := my $b = 2;
no strict;
my $b = :2<11110000>;
# -> 240 ## A binary (base 2) number
my $a = :16<FF>;
# -> 255 ## A hexadecimal (base 16) number
my $b = :2("11110000");
# -> 240 ## A binary (base 2) number
for "azea".HOW.^attributes { .name.say }
# Candidates
say .signature for @arr.^method_table{'AT-POS'}.candidates;
FALLBACK
is called for methods with unknown namecall____ — call next matching candidate in the chain and come back here next____ — just go to next matching candidate in the chain and don’t come back ____same — use the same arguments as were used for current candidate ____with — make the operation with these new arguments provided samewith — make the same call from scratch, following a new dispatch chain, with these new arguments, and come back
Perl | C |
---|---|
int8 | int8_t, also used for char |
int16 | int16_t, also used for short |
int32 | int32_t, also used for int |
int64 | int64_t |
uint8 | uint8_t, also used for unsigned char |
uint16 | uint16_t, also used for unsigned short |
uint32 | uint32_t, also used for unsigned int |
uint64 | uint64_t |
Long | long |
Longlong | long Long, at least 64-bit |
num32 | float |
num64 | double |
Str | string |
CArray[int32] | int*, an array of ints |
Pointer[void] | void*, can point to all other types |
bool | bool from C99 |
size_t | size_t |
.comb -> array of chars
.chars -> length
.flip -> reverse
~ -> stringify (the intify is +)
.IO -> get IO::HANDLE
.index “na” -> first index of occurence
.rindex “na” -> last index
.contains “na”
.substr pos, length
Can be invoked with 'toto'.^methods