3 ms·
> I don't think "say 1.WHAT" is reasonable syntax in the slightest. 1 is an integer. In Perl 6 integers are objects and have methods. The method calls are dis
by kbenson 11y ago
> I don't think "say 1.WHAT" is reasonable syntax in the slightest.
1 is an integer. In Perl 6 integers are objects and have methods. The method calls are distinguished by periods, as has become the most common way to call methods in programming languages.
Is your main complaint that it just looks weird? Is there something you would expect it to be other than a method on an integer or numeric type? Personally, while yes, it does look somewhat weird, the uniformity of knowing you can call .WHAT on anything is nice.
You get one guess as to what 1.23.WHAT does.
- logicallee 11y agohi - my complaint was over the choice of specifically the word WHAT (and not a different word), and in capitals.