f:{[a;b]
c:1;
show .z.P;
show system “v”; / can i list local variables?
value “a”} / can i do meta-programming on variables?
thx
f:{[a;b]
c:1;
show .z.P;
show system “v”; / can i list local variables?
value “a”} / can i do meta-programming on variables?
thx
Value function gives all details about function which also includes names of local variables.
For meta programming, depends what you want to do. If you just want to execute input parameter as it is, use ‘value’. Here is on example:
f:{[a]
c:1
show (value .z.s)[2]; // local variable ‘c’
value string a; / execute a
}
f[max 1 2 3]
output:
`c
3
delete globalVar from . / delete global variable delete localVar from
localNamespace / How can I do this?
You can’t
Locals are on the stack maintained by position - names are just conveniences for those positions