Partial function application
All Code objects have the .assuming method, which partially applies its arguments. For both type safety reasons and parsing sanity reasons we do not believe in implicit partial application by leaving out arguments. Also, people can understand "assuming" without being steeped in FP culture.
Output:
The *+2
is also a form of partial application in Raku. In this case we partially apply the infix:<+>
function with a second argument of 2. That is, the star (known as the "whatever" star) indicates which argument not to apply. In contrast to languages that keep some arguments unbound by leaving holes, the explicit star in Raku allows us to avoid syntactic ambiguity in whether to expect a term or an infix operator; such self-clocking code contributes to better error messages when things go wrong.
Last updated