values - Returns the list of values of a context.
values (variable);
This function is used to return the list of values of a context. It returns each element associated with the ones defined at the beginning. If it used as a function, it returns the list of values as an array. However, if it is used as a callback, it returns each key.
Note: In the followings examples, the _ between the { should be removed to make it work.
res={_{ for i values({x:1,y:2}) do i; endfor; }}. return res=12. res={_{ for i values({x:[1,3],y:{a:2,b:"4"}}) do i; endfor; }}. return res=\[1,3\]\{"a":2,"b":"4"\}. res={_{ a={x:1,y:2}; for i values(a) do i; endfor }}. return res=12. res={_{ a={}; for i values(a) do i; endfor }}. return res=. res={_{ for i values({}) do i; endfor }}. return res=. res={_{ for i values(123) do i; endfor }}. return .*is not a context.* res={_{ values({x:1,y:2}); }}. return res=\[1,2\]. res={_{ a={x:1,y:2}; values(a); }}. return res=\[1,2\]. res={_{ values({}); }}. return res=\[\]. res={_{ values(123); }}. return .*is not a context.* res={_{ a={x:[1,3],y:{a:2, b:4}}; values(a); }}. return res=\[\[1,3],\{"a":2,"b":4}\].
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