[pypy-svn] r44471 - pypy/dist/pypy/lang/scheme
jlg at codespeak.net
jlg at codespeak.net
Sat Jun 23 14:08:32 CEST 2007
Author: jlg
Date: Sat Jun 23 14:08:30 2007
New Revision: 44471
Modified:
pypy/dist/pypy/lang/scheme/TODO.txt
pypy/dist/pypy/lang/scheme/object.py
Log:
nested s-expr evalutaion test added
Modified: pypy/dist/pypy/lang/scheme/TODO.txt
==============================================================================
--- pypy/dist/pypy/lang/scheme/TODO.txt (original)
+++ pypy/dist/pypy/lang/scheme/TODO.txt Sat Jun 23 14:08:30 2007
@@ -3,10 +3,9 @@
- evaluate simple expressions like
(* 6 7) or even (+ 1 2 3 4)
- - convert nodes from AST tree into W_xxx - tree.dispatch()
- - evaluate the tree
+ - parsing is done by some shiny new Carl's thingy
W_xxx object like W_Fixnum should eval to itself despite context
- - implement basic operations like * / and so on
+ - implement basic operations like + * / and so on
Do next
-------
Modified: pypy/dist/pypy/lang/scheme/object.py
==============================================================================
--- pypy/dist/pypy/lang/scheme/object.py (original)
+++ pypy/dist/pypy/lang/scheme/object.py Sat Jun 23 14:08:30 2007
@@ -128,7 +128,6 @@
#not sure though any operations should exist here
#it its very similar to operation.add
#############################
-
def add_lst(ctx, lst):
return apply_lst(ctx, lambda x, y: x + y, lst)
@@ -155,8 +154,15 @@
else:
return W_Float(acc)
+######################################
+# dict mapping operations to callables
+# callables must have 2 arguments
+# - ctx = execution context
+# - lst = list of arguments
+#######################################
OPERATION_MAP = \
{
'+': add_lst,
'*': mul_lst,
}
+
More information about the Pypy-commit
mailing list