in reply to Re^2: [Perl 6] auto subs from methods?
in thread [Perl 6] auto subs from methods?
As for having to repeat the class name, yes, that's currently an issue, particularly since you have to declare the type of your $defobj before the use. But I think I mentioned the current syntax is still negotiable, and would certainly be open to suggestions for syntax that is both composable and succinct. We could go as far as to have a variant usesingle that autocurries a singleton, but then we have to decide how it composes with the filters you also requested above, and where the singleton object ends up getting stored, if it's to have some kind of user-accessible name. For composability there are times you might want to return the singleton, and times you might want to return the class's protoobject. It's difficult to do both of those simultaneously.
|
|---|