Raku_topic_var
I like the default variable $_
.. the ‘Topic variable’.
.say for <olle nisse janne pelle kalle>;
for
enumerates through the list. Every element in order is assigned to $_
. The empty .say
is interpreted as $_.say
. In Ruby it would be the same as not having to type it
.
%w(olle nisse janne pelle kalle).each { puts }
You can do something similar in Ruby:
class String
def say = ( puts self )
end
%w(olle nisse janne pelle kalle).map(&:say)