3 ms·
Every paradigm (imperative, functional, unicode graphemes, regex 2.0, grammar, OO) is a tool. The more tools you have in your toolbox, the more you can pick the
by librasteve 2y ago
Every paradigm (imperative, functional, unicode graphemes, regex 2.0, grammar, OO) is a tool. The more tools you have in your toolbox, the more you can pick the right tool for the job. Raku does a serious job of putting all these tools into one language. This makes them composable and Larry Wall did a great job of making it all fit together in a natural expressive way.
Is the result simple, no. Can you learn it as quickly as python, not really (you can stay at the surface and not use all the stuff). Is it worth the effort - absolutely! Is it fun, yep.
A quick example to your point.
sub foo(\x) { say x }
foo ‘hi’; #hi
‘hi’.&foo; #hi
So yes any sub can be called like a method if you use &.