def __call__(self, forms, var_env, func_env, macro_env): """Behavior of SortedBuiltinFunction. """ args = self.eval_forms(forms, var_env, func_env, macro_env) # If an argument is empty list. if args.car is Null(): return PyObject([]) return PyObject(self.exec_func(py_func_name='sorted', args=args))
def __call__(self, forms, var_env, func_env, macro_env): """Behavior of SliceBuiltinFunction. """ args = self.eval_forms(forms, var_env, func_env, macro_env) # Sets slice object for getting all elements. if args is Null(): return PyObject(slice(None, None, None)) return PyObject(self.exec_func(py_func_name='slice', args=args))
def __call__(self, forms, var_env, func_env, macro_env): """Behavior of AbsBuiltinFunction. """ args = self.eval_forms(forms, var_env, func_env, macro_env) return PyObject(self.exec_func(py_func_name='abs', args=args))