TropicSapling/triforce

Macro variables & functions? (improved macros)

Opened this issue · 0 comments

#macro = while true { doSomething(); };
macro // expands macro

// Perhaps even function macros?
func #macro_func(arg1, arg2) {
    doSomethingWith(arg1, arg2);
}

macro_func(123, 456); // expands macro_func with values passed in replacing args

// This could be used in interesting ways:
func #+=(n1, n2) {
    n1 = n1 + n2;
}

x = 123;
x += 456;
x // 579

(this would probably replace the current macros, also these macros are "hygienic")