moved back to old acc
[vox.git] / test / syntax / classdef.vx
blobc433e3585287e7ded7fb22f2a1b0be4adba9ea19
2 class NameOfClass {
3     /* the constructor can be defined both with and without the
4        'function' keyword. both do exactly the same, and both are
5        perfectly valid.
6        */
7     constructor()
8     {
9         println("Goodbye!")
10     }
12     /* any redeclared function silently overwrites any previous
13        function decl with the same name, thus the previous
14        constructor will never get called */
16     function constructor()
17     {
18         println("Hello!")
19     }
22 NameOfClass()
24 /* classes can also be declared local, or as slots: */
26 local MyHiddenClass = class {}
28 MySlotClass := class {}