[pypy-svn] r44997 - in pypy/dist/pypy/lang/scheme: . test

jlg at codespeak.net jlg at codespeak.net
Fri Jul 13 09:40:09 CEST 2007


Author: jlg
Date: Fri Jul 13 09:40:08 2007
New Revision: 44997

Modified:
   pypy/dist/pypy/lang/scheme/TODO.txt
   pypy/dist/pypy/lang/scheme/object.py
   pypy/dist/pypy/lang/scheme/test/ex.ss
Log:
arithmetic operations uses to_fixnum, to_float instead of generic to_number

Modified: pypy/dist/pypy/lang/scheme/TODO.txt
==============================================================================
--- pypy/dist/pypy/lang/scheme/TODO.txt	(original)
+++ pypy/dist/pypy/lang/scheme/TODO.txt	Fri Jul 13 09:40:08 2007
@@ -18,6 +18,8 @@
 
 - comparison: < > eq? eqv?
 
+- rational, complex number types
+
 Do in some future
 -----------------
 

Modified: pypy/dist/pypy/lang/scheme/object.py
==============================================================================
--- pypy/dist/pypy/lang/scheme/object.py	(original)
+++ pypy/dist/pypy/lang/scheme/object.py	Fri Jul 13 09:40:08 2007
@@ -244,9 +244,9 @@
 
     def oper(self, x, y):
         if isinstance(x, W_Float) or isinstance(y, W_Float):
-            return W_Float(self.do_oper_float(x.to_number(), y.to_number()))
+            return W_Float(self.do_oper_float(x.to_float(), y.to_float()))
         else:
-            return W_Fixnum(self.do_oper_int(x.to_number(), y.to_number()))
+            return W_Fixnum(self.do_oper_int(x.to_fixnum(), y.to_fixnum()))
 
 class Add(ListOper):
     def do_oper_int(self, x, y):

Modified: pypy/dist/pypy/lang/scheme/test/ex.ss
==============================================================================
--- pypy/dist/pypy/lang/scheme/test/ex.ss	(original)
+++ pypy/dist/pypy/lang/scheme/test/ex.ss	Fri Jul 13 09:40:08 2007
@@ -20,5 +20,7 @@
                (even? (- n 1))))))
   (even? 12))
 
+(+ 1 2 3)
+(+ 1 2.9 2)
 (quit)
 



More information about the Pypy-commit mailing list