keys - Returns the list of keys of a context.
keys (variable);
This function is used to return the list of keys of a context. A context is a table with its elements indexed with a characters string. Each element of the context is related to a key.
If it is used as a function, it will return the list of keys as an array.
If it is used as a callback, it will return each key.
Note: In the followings examples, the _ between the { should be removed to make it work.
res={_{ for i keys({x:1,y:2}) do i; endfor; }}. return res=xy. res={_{ a={x:1,y:2}; for i keys(a) do i; endfor }}. return res=xy. res={_{ a={}; for i keys(a) do i; endfor }}. return res=. res={_{ for i keys({}) do i; endfor }}. return res=. res={_{ for i keys(123) do i; endfor }}. return .*is not a context.* res={_{ keys({x:1,y:2}); }}. return res=["x","y"]. res={_{ a={x:1,y:2}; keys(a); }}. return res=["x","y"]. res={_{ keys({}); }}. return res=[]. res={_{ keys(123); }}. return .*is not a context.*
Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com