Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lisp in Python as a library (not crossposted)

8 views
Skip to first unread message

Ville Vainio

unread,
Oct 21, 2003, 2:39:04 AM10/21/03
to
Apparently there is some kind of toy Lisp interpreter written in Python:

http://www.biostat.wisc.edu/~annis/creations/PyLisp/pylisp.html

However, how about extending the idea? I.e., making all the Python
functions callable from Lisp, and having all the objects in Lisp
actually be Python objects (using some classes like cons cells etc.):


-----------------------------
lst = readlisp("""(defun sum (x y) (+ x y))""")

# lst == <cons cell at 0x123>

ns = mk_lisp_namespace() # this has lambda, defun, defmacro & friends

eval (lst,ns)

# ns["sum"] == <cons cell>

def sum2(x,y):
return x+y

ns["sum2"] = sum2

s = evallist("(sum2 2 3)",ns)

# s == 5

---------------------------------

Sounds like a nice way to bring us all the macro power our Lisp
friends glorify so much, and a way to end all the inter-newsgroup
flamewars once and for all :-).

--
Ville Vainio http://www.students.tut.fi/~vainio24

Alan Gauld

unread,
Oct 21, 2003, 5:58:39 PM10/21/03
to
On 21 Oct 2003 09:39:04 +0300, Ville Vainio

<ville.spamm...@spamtut.fi> wrote:
> Apparently there is some kind of toy Lisp interpreter written in Python:
>
> http://www.biostat.wisc.edu/~annis/creations/PyLisp/pylisp.html

Danny Yoo did a basic Scheme or Lisp intrpreter in Python a few
years ago - it may be on the Useless Python website...???


Are you listening Danny?

Alan G.

Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld

Robin Becker

unread,
Oct 22, 2003, 4:24:52 AM10/22/03
to
In article <3f95abc6....@news.blueyonder.co.uk>, Alan Gauld
<alan....@btinternet.com> writes
I wish all the lisp versus python wars would go away, but if they really
want to do 'my language is bigger than your language' then cross
language translation is the way to go. Then they can argue about code
size efficiency etc in some reasonable way. Assuming both languages are
Turing complete probably eliminates most of the arguments anyway.
--
Robin Becker

Damien Wyart

unread,
Oct 22, 2003, 5:19:22 AM10/22/03
to
* alan....@btinternet.com (Alan Gauld) in comp.lang.python:

> Danny Yoo did a basic Scheme or Lisp intrpreter in Python a few years
> ago - it may be on the Useless Python website...???

It can be found here :

<http://www-hkn.eecs.berkeley.edu/~dyoo/python/pyscheme/index.html>

--
DW

0 new messages