serious bugfix in Raise_IdxError (number got formatted as string, causing a segmentat...
[vox.git] / test / syntax / classdef.vx
blob297a797ddeda4504aa60b011f3dd5a0524bab95c
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 {}