Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Support BUILD #20

Open
schwern opened this issue Apr 3, 2014 · 1 comment
Open

Support BUILD #20

schwern opened this issue Apr 3, 2014 · 1 comment

Comments

@schwern
Copy link
Contributor

schwern commented Apr 3, 2014

Have new support a user written BUILD function.

  • Called after the object is created.
  • It takes no arguments and returns nothing.
  • The decision to call BUILD or not should be made by the mite compiler, not at runtime
  • BUILD inheritance is special...

From Moose::Manual::Construction...

   The interaction between multiple "BUILD" methods in an inheritance
   hierarchy is different from normal Perl methods. You should never call
   "$self->SUPER::BUILD", nor should you ever apply a method modifier to
   "BUILD".

   Moose arranges to have all of the "BUILD" methods in a hierarchy called
   when an object is constructed, from parents to children. This might be
   surprising at first, because it reverses the normal order of method
   inheritance.

   The theory behind this is that "BUILD" methods can only be used for
   increasing specialization of a class's constraints, so it makes sense
   to call the least specific "BUILD" method first. Also, this is how Perl
   6 does it.
@tobyink
Copy link

tobyink commented Jul 2, 2022

I've moved the Mite issue tracker here.

This is now implemented.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants