UNPKG

calcium-lang

Version:
15 lines 462 B
import { default as Sym } from "../symbol"; import { evaluate } from "../util"; /** * built-in `len()` function * @param args accept an argument that is a list or a tuple or a str * @param env * @returns an integer value */ const len = (args, env) => { const iterable = evaluate(args[0], env); const length = Reflect.get(iterable, Sym.len); return length; // should be an internal int value }; export default len; //# sourceMappingURL=len.js.map