4 // Transition from global 'self' to local 'this'
6 [[alias("self")]] entity __self;
8 // Step 1: auto oldself
10 #define SELFPARAM() noref entity this = __self
11 #define setself(s) (__self = s)
15 // Step 2: check SELFPARAM() is present for functions that use self
17 #define SELFPARAM() [[alias("__self")]] noref entity this = __self
18 #define setself(s) (__self = s)
24 #define SELFPARAM() noref const entity this = __self
25 entity setself(entity e) { return self = e; }
26 entity getself() { return self; }
27 #define self getself()
30 // Step 4: enable when possible
31 // TODO: Remove SELFPARAM in favor of a parameter
33 #define SELFPARAM() noref const entity this = __self