Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "recursive virtual constexpr sodomy"
-
Consider,
```
namespace A;
macro m00 a,b;
··display a,b;
end macro;
macro m01 a;
··m00 a,$0A;
end macro;
m01 $24;
end namespace;
```
OUT: $0A24 ("$\n").
Ah, but you just HAD to fuck me in the ass, didncha fasm2? Initializing anal bleeding:
```
namespace B;
A.m01 $24;
end namespace;
```
OUT: illegal instruction 'm00'.
Explanation: macros carry no context, and so 'm00' is unreachable from 'B' namespace.
Could I maybe write a code-capture macro to generate a wrapper that resets the namespace? Yes, and in fact, I did; brilliant exercise in mystical mindfuckery.
But why try so hard? Just pass the fucking ref, like a MAN.
EXPLICIT CTX, BITCH.
```
define @CAS $non; current addressing space
define %ICE @CAS;
macro self:PA&; recursive macro, uuuh spooky-spooky
··match ice , %ICE;
····; self->proc(args)
····match =-=> proc (args) , PA;
······path.proc ice,args; pass ref and args
····; ^self->proc()
····else match =-=> proc () , PA;
······path.proc ice; pass ref only
····; ^sneaky sneaky. set current context when self ctx;
····else match cas , @CAS;
······%ICE equ cas.PA;
····end match;
··end match;
end macro;
```
ALL TOGETHER NOW
```
namespace A;
macro m00 ice,a,b;
··display a,b;
end macro;
macro m01 ice,a;
··self->m00(a,$0A); could also be 'ice.m00 ice,a,$0A' lmao
end macro;
end namespace;
namespace B;
self A; set ice
self->m01($24);
restore %ICE; back to previous
end namespace;
```
OUT: $0A24 ("$\n").
A-há, now **I** got you from behind motherfucker!
Final note: this is 100% perl DNA seeping through the cracks of my sanity and into a fresh fasm2 framework. Why? Dingle-dongle-jungle-berries, that's why. Also crack.
Have a nice wallop.18