Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love self too, but I'd like the syntax to be

def self.meth(arg0) instead of def meth(self, arg)

so the declaration looked ike the call. (And yes, the self can be a different name so a similar syntax can work for classmethods.)



The new developments in Perl syntax mostly solve this by having an explicit separator for invocant specification:

    method foo ($bar, $baz) { ... }
has $self, $bar and $baz, while

    method foo ($class: $bar, $baz) { ... }
has $class, $bar and $baz.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: