develooper Front page | perl.perl6.users | Postings from June 2018

Re: mixin syntax: does vs but

Thread Previous | Thread Next
From:
Timo Paulssen
Date:
June 13, 2018 01:35
Subject:
Re: mixin syntax: does vs but
Message ID:
8d526e54-453b-0958-36f3-52cc6b43da44@wakelift.de
You can override WHAT with a method, you just have to use a syntax
that's not literally .WHAT, like this:

    class Test { method WHAT() { say "i'm here" } }; Test."WHAT"();
    # → i'm here

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About