4 [[alias("self")]] entity __self;
6 // Can't wrap with do-while as block may contain continue or break
7 #define WITH(type, name, value, block) { \
8 type __with_save = (name); \
14 // Transition from global 'self' to local 'this'
16 // Step 1: auto oldself
18 #define SELFPARAM() noref entity this = __self
19 #define setself(s) (__self = s)
23 // Step 2: check SELFPARAM() is present for functions that use self
25 #define SELFPARAM() [[alias("__self")]] noref entity this = __self
26 #define setself(s) (__self = s)
32 #define SELFPARAM() noref const entity this = __self
33 entity setself(entity e) { return self = e; }
34 entity getself() { return self; }
35 #define self getself()
38 // Step 4: enable when possible
39 // TODO: Remove SELFPARAM in favor of a parameter
41 #define SELFPARAM() noref const entity this = __self
45 #define spawn() new(entity)