// title: function vars/args as dictionary // author: vividsnow // description: // shortcuts to get function variables/arguments state as dictionary // code: // variables ({ var aa = 3, bb = aa + 1, cc = 5; { |d v| d.inject((), { |a i k| a[i] = v[k] }) }.(thisFunctionDef.varNames, this.getBackTrace.vars); }.()) // arguments ({ |aa=1 bb=3| { |d v| d.inject((), { |a i k| a[i] = v[k] }) }.(thisFunctionDef.argNames, this.getBackTrace.args); }.()) //both ({ |c=3 r=#[3,1]| var aa = 3, bb = r; { |trace| ['arg','var'].inject((), { |a type| var trace_vals = trace.perform((type++'s').asSymbol); a[type] = trace.functionDef.perform((type++'Names').asSymbol).inject( (), { |a i k| a[i] = trace_vals[k]}) }); }.(this.getBackTrace); }.(r:[4,1]));