-
Notifications
You must be signed in to change notification settings - Fork 4
drop footgun support #13
Comments
Hey Matt - o.augment is a low-level function for extending an object's prototype. Think of it as poor-man's single-inheritance extends() support in Moo(se) terms. It wasn't meant to have anything to do with the Moose augment which I agree is terrible. The only method modifiers supported by o.js are before, after, and around. |
The low-level functions for method modifiers: https://github.com/bluefeet/o-js/blob/current/doc/Plumbing.md Method modifiers as part of traits: https://github.com/bluefeet/o-js/blob/current/doc/o-Trait.md |
Oooooh. Right. I, er, wonder if it might be worth picking a different name and leaving augment as an undocumented alias for a while for backcompat? While clearly I suffered a reading comprehension error due to skimming, given i'm now including o-js in my slides for 'Moo(se) ported to other languages' I may end up sending more people your way who'll make the same mistake :) |
Oh, thanks for including this in your slides. o.js is heavily inspired by Moo(se) for sure, and Type::Tiny. Ya, renaming |
augment is always a terrible idea, override is almost always better expressed as around.
There may be more - many of the things I skipped in Moo were because they'd proven to be a bad idea and were disrecommended in Moose - but those two would definitely be a start.
augment especially scares the crap out of me.
The text was updated successfully, but these errors were encountered: