diff --git a/lib.py b/lib.py index 9125c22..3346a14 100644 --- a/lib.py +++ b/lib.py @@ -65,7 +65,7 @@ def execute(program): return subs elif ctx[0] == _ident("miracle"): - return _box(eval(_destr(subs[1]))[_destr(subs[2])](*[(i if type(i) == type([]) else i[1]) for i in _fixarr(subs[3])])) + return _box(getattr(eval(_destr(subs[1])), _destr(subs[2]))(*[(i if type(i) == type([]) else i[1]) for i in _fixarr(subs[3])])) elif ctx[0] == _ident("def"): ids[ctx[1]] = subs[2] return ids[ctx[1]] diff --git a/lib/kokoro.klambda b/lib/kokoro.klambda index 6d2fdfd..5e1efa9 100644 --- a/lib/kokoro.klambda +++ b/lib/kokoro.klambda @@ -1,10 +1,10 @@ (def spit (lambda (cunny) (miracle - "__builtins__" "print" (id cunny)))) + "__import__('builtins')" "print" (id cunny)))) (def input (lambda () (miracle - "__builtins__" "input" ("")))) + "__import__('builtins')" "input" ("")))) (def thesis (lambda () (spit ("this language belongs to makise kurisu. there are many like it, but this one is hers.")))) diff --git a/lib/lists.klambda b/lib/lists.klambda index 52e9147..e0637c5 100644 --- a/lib/lists.klambda +++ b/lib/lists.klambda @@ -1,6 +1,6 @@ (def length (lambda (cunny) (miracle - "__builtins__" "len" (cunny)))) + "__import__('builtins')" "len" (cunny)))) (def append (lambda (item, victim) (insert (length victim) item victim))) diff --git a/lib/string.klambda b/lib/string.klambda index 02bbe5f..c797db8 100644 --- a/lib/string.klambda +++ b/lib/string.klambda @@ -1,3 +1,3 @@ -(def str2lst (lambda (l) +(def str2lst (lambda (s) (miracle - "__builtins__" "list" (l)))) \ No newline at end of file + "__import__('builtins')" "list" (s))))