4 ms·
Ok, twigils, whatever. They're next to each other so they're double the crazyness. Like the $#last_index in Perl. In Raku the . and ! are used to designate a pr
by petre 7y ago
Ok, twigils, whatever. They're next to each other so they're double the crazyness. Like the $#last_index in Perl. In Raku the . and ! are used to designate a private or public variable within a class definition. I got it backwards, which sort of proves the whole point. Push a private array nested into another and you have a bunch of gibberish worse than in Perl, where you'd only prefix it with \. Use an auxilliary variable and it feels too verbose. OTOH @{$hash{array_ref}} dereferentiation in Perl is quite annoying. And no, $hash{array_ref}->@ is definitely not how you fix this mess. I agree that sigils offer some insight into what type of the variable you are looking at.
Great improvements are not enough compared to other languages, even Ruby which is quite slow itself. Have you wrote anything in Node, Dart or Lua? They feel like a F1 car where Raku is an 17th century cart.
- popovmp 7y agoYou probably mean: `@{ $hash->{array_ref} }` or `@{ $hash(array_ref) }`. Either way shows exactly what is the structure of `hash`.
- petre 7y ago%hash is an actual hash with a nested array ref inside. If $hash is a reference to such a hash, yes. Never used the second syntax and I doubt that it works with something other than subroutines, but in that case it's either hash() where hash is an actual sub, or $hash->() where $hash is a subroutine reference. Both return an array refetence. See? Confusing. That's why people hate Perl. At least I'm glad dereferencing is gone in Raku.