a python interpreter implemented in common lisp

19 views
Skip to first unread message

Junsong Li

unread,
Apr 10, 2013, 11:46:05 PM4/10/13
to lamb...@googlegroups.com
Hi,

I just played around with the clpython: http://common-lisp.net/project/clpython/index.html. It is a python interpreter implemented in common lisp. Playing with its repl is quite interesting.

It still has many things incomplete, for example, the __import__ is missing.; and its globals() and locals() will not result in a dict value, but a straight symbol-hash-table. Also, I cannot run unittest in it because there is no the top-level-module __main__ in it.

>>> locals()
#<CLPYTHON::SYMBOL-HASH-TABLE {_: #1=#<CLPYTHON::SYMBOL-HASH-TABLE {_: #1#, __: 0, ___: #1#, __name__: "__main__", __debug__: 1, unittest: #<module `unittest' :src #P"/Users/LJS/GITHUB/CL-PYTHON/unittest.py" :binary #P"/Users/LJS/.CACHE/COMMON-LISP/SBCL-1.1.3-MACOSX-X64/Users/LJS/GITHUB/CL-PYTHON/un...
>>> d = {1:34}
{1: 34}
>>> d[1]
34
>>> d
{1: 34}
>>> l = [d]
[{1: 34}]
>>> l[0][1] = 45
45
>>> d
{1: 45}

Maybe you also want to try it a little bit. Have fun :D


Joe Gibbs Politz

unread,
Apr 11, 2013, 8:45:29 AM4/11/13
to lamb...@googlegroups.com
Does it have a test suite we can try on λPy?
> --
> You received this message because you are subscribed to the Google Groups "lambda-py" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lambda-py+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Junsong Li

unread,
Apr 11, 2013, 8:51:39 PM4/11/13
to lamb...@googlegroups.com
It is based on python2, and Its test cases are written as strings passed to "interp" function in lisp file. I think it is not worth for us bringing them into lambda-py.
Reply all
Reply to author
Forward
0 new messages