On Wed, Jun 3, 2020 at 10:07 AM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> Is there a way to write a methods as I would write
> a sub and avoiding the class thing?
>

I re-read the whole thread, but I still fail to understand what a "method
as a sub, avoiding the class thing" is.
Yet, I'm trying a mind-reading trick: when you say "method" perhaps you
mean a sub you can call using a method call syntax.
If that's the case, then one may write something like this:

sub f($x) { $x² }

6.&f; # output: 36

Did the trick work?

-- 
Fernando Santagata

Reply via email to