| 1 |
#include <tads.h> |
| 2 |
#include <dynfunc.h> |
| 3 |
|
| 4 |
main(args) |
| 5 |
{ |
| 6 |
local a = 'A!'; |
| 7 |
local b = 'B!'; |
| 8 |
|
| 9 |
print('a = {a}, b = {b}\n'); |
| 10 |
|
| 11 |
local fr = t3GetStackTrace(1, T3GetStackDesc).frameDesc_; |
| 12 |
Compiler.eval('a += \'*MOD*\'', fr); |
| 13 |
"After eval: a=<<a>>, b=<<b>>\n"; |
| 14 |
|
| 15 |
f(); |
| 16 |
} |
| 17 |
|
| 18 |
f() |
| 19 |
{ |
| 20 |
local b = 'f.B!'; |
| 21 |
useVal(b); |
| 22 |
|
| 23 |
local fr = t3GetStackTrace(nil, T3GetStackDesc).mapAll({x: x.frameDesc_}); |
| 24 |
tadsSay(Compiler.eval('\'a=<\<a>\>, b=<\<b>\>\\n\'', fr)); |
| 25 |
} |
| 26 |
|
| 27 |
useVal(x) |
| 28 |
{ |
| 29 |
} |
| 30 |
|
| 31 |
print(msg) |
| 32 |
{ |
| 33 |
local f = t3GetStackTrace(2, T3GetStackDesc).frameDesc_; |
| 34 |
tadsSay(rexReplace('<lbrace>(<^rbrace>*)<rbrace>', msg, |
| 35 |
{m: Compiler.eval(rexGroup(1)[3], f)})); |
| 36 |
} |