Todd,
You said you asked if you could create your own methods, and that you
were told 'no'. That was a surprising statement, so I asked about some
context about who would say such a stupid(?!) thing. Seems like this was
a half-remembered 'no' somewhere in a cloud . Lets leave it there.
You often ask questions that get interesting answers. But rather than
guessing what you're thinking, perhaps you might explain how you see a
'subroutine' differing from a 'method'. If you look at the Raku
documentation, which I know for you, is like shoving your head in a
barrel of cold water, you will find quite a few examples of methods,
subs, blocks, and pointies, together with things called signatures.
Repeating any of this material won't help you. So what is a method to
you? How do you think it might be used?
Richard
On 01/06/2020 22:06, ToddAndMargo via perl6-users wrote:
On 2020-06-01 13:46, Richard Hainsworth wrote:
Todd,
I'd be interested to see where someone said 'no' to creating your own
methods.
Methods are integral to the whole idea of a class.
It's also clear throughout the Raku documentation that there are methods.
But for a method, you need a class. Peter put the method in a class.
Do you want a method 'outside' a class? If so, what exactly do you
think a method outside a class would do?
No idea what you are getting at. I would just like
to create and run them as I do with subroutines.
Richard
Hi Richard,
I checked my sent bin and I had deleted it back a
years, so it did not show up. I also checked
https://www.mail-archive.com/perl6-language@perl.org/
And if it is there is is drowned out by so many
other hits.
And I checked my own internal documentation, and
it says a lot about what they are, but not about
creating them (it will now).
So, Rats. Maybe someone else reading this will
remember.
Do you have a favorite primer on creating methods
you could send me a link to?
I am delighted I can do my own methods. Raku,
now 1002 ways of doing everything! I do adore Raku!
-T