Magik (programming language): Difference between revisions

Content deleted Content added
Pchr8 (talk | contribs)
m Standardize spelling of Initialise/Initialize
Pchr8 (talk | contribs)
m Undid revision 938375266 by Pchr8 (talk)
Line 68:
}, {:parent_object_a, :parent_object_b})
</pre>
This code fragment will define a new exemplar called <code>my_object</code> that has two slots (or fields) called <code>slot_a</code> (pre-initialized to 34) and <code>slot_b</code> (pre-initializedinitialised to "hello") that inherits from two existing exemplars called <code>parent_object_a</code> and <code>parent_object_b</code>.
 
===Comparison===
Line 105:
# Call the parent implementation.
_super.init(name, age)
# InitializeInitialise the slots.
.name << name
.age << age