I did not find anything mentioning this anywhere, but it is such a basic feature of class based programming, that I can’t imagine it is not there, somewhere, somehow.

class One { method do_it {say 1} }
class Two : isa(One) { method do_it { super()->do_it; say 2} } # or so...
  • snake_cased@lemmy.mlOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    I can do One::do_it($self) or One->can('do_it')->($self), but that seems very ugly and against the pattern.