Documentation for submethod BUILD
assembled from the following pages:
Language documentation: Type system §
From Type system
(Type system) submethod BUILD §
The submethod BUILD
is (indirectly) called by .bless. It is meant to set private and public attributes of a class and receives all names attributes passed into .bless
. The default constructor .new defined in Mu
is the method that invokes it. Given that public accessor methods are not available in BUILD
, you must use private attribute notation instead.
; C.new.say; C.new('answer').say;# OUTPUT: «C.new(attr => 42) # C.new(attr => "answer")»