6 0. Changed '(operator)' to '->operator'
7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 See 4.2.operator-overloading.
10 This should only interest people who have already written lwc code
14 1. Destruction through stack unwind
15 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 This is achieved with the introduction of a new declaration specifier (and
18 also a reserved word), '__unwind__'. Presented in 3.2.exceptions
24 Useful as a hint to auto-functions to emit no code. Presented in
28 3. Long break and continue
29 ~~~~~~~~~~~~~~~~~~~~~~~~~~
31 break and continue may be followed by a small integer number. This number
32 denotes how many loop bodies will the control break out of. For example:
41 will break out of both loops and has *almost* the same effect as:
52 It's not that we hate 'goto'. On the contrary; many lwc developers feel
53 that goto is a wonderful thing. The problem is that the lwc preprocessor
54 does not work around goto and destruction of local objects.
55 Long break and long continue will make sure that all the nested local
56 objects will be properly destructed.
77 4. Calling parent's functions
78 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80 Since lwc doesn't have C++'s scope operator (::), we used casts to call
81 specific functions from parent classes. This worked but it had a lot of
82 typing. Now it's possible to use the syntax 'class.func()'. For example:
101 This only happens inside other member functions, for classes that are parent
102 and only for functions.
104 5. Modular data members
105 ~~~~~~~~~~~~~~~~~~~~~~~
107 Data class members declared 'modular' are exactly the same as C++'s
108 'static' data members: they are global data in reallity. This is just a
109 decorative feature but it completes the 'modular functions' feature.
123 Moreover, if the 'modular' precedes the declaration of a class it is
124 not only applied for member functions, but for data members as well.
125 Therefore, we can have something like namespaces:
127 #define namespace modular class
144 A more extreme example:
146 #define namespace modular class
151 int &operator [] (int i) { return X [2*i]; }
159 And countless other combinations...