Could Emacs be rewritten in Python?

Kim Petersen kp at kyborg.dk
Wed Apr 9 12:12:17 EDT 2003


Kim Petersen wrote:

> implementation of let:
> 
> def let(cons,namespace):
>    # of course a scheme to reasonably map lisp functions to python
>    # implementations is needed - i just assume that (f x y z) is called
>    # here as f(lisplist(x,y,z),namespace)
>    #
>    context=namespace.getcontext()
>    defs=cons.car()
>    body=cons.cdr()
>    if iscons(defs.car()):
>       namespace.localvar(defs.car().car(),defs.car().cdr().car())
>    else:
>       namespace.localvar(defs.car())
>    lispeval(body,namespace)

forgot to do:
      namespace.restorecontext(context)

-- 
Med Venlig Hilsen / Regards

Kim Petersen - Kyborg A/S
IT - Innovationshuset
Havneparken 2
7100 Vejle
Tlf. +4576408183 || Fax. +4576408188





More information about the Python-list mailing list