Examples
This is an example of a class Point and its subclass Point3D:
There is a new set_to method in the Point3D class so the method of the same name defined in the Point class is not invoked in the case of Point3D instances. The clear method on the other hand is not replaced but extended in the subclass, so both methods are run in the correct order.
This is the same using the MooseX::Declare extension:
Read more about this topic: Moose (Perl)
Famous quotes containing the word examples:
“Histories are more full of examples of the fidelity of dogs than of friends.”
—Alexander Pope (16881744)
“There are many examples of women that have excelled in learning, and even in war, but this is no reason we should bring em all up to Latin and Greek or else military discipline, instead of needle-work and housewifry.”
—Bernard Mandeville (16701733)
“In the examples that I here bring in of what I have [read], heard, done or said, I have refrained from daring to alter even the smallest and most indifferent circumstances. My conscience falsifies not an iota; for my knowledge I cannot answer.”
—Michel de Montaigne (15331592)