[pypy-svn] r48033 - pypy/dist/pypy/lang/smalltalk

niko at codespeak.net niko at codespeak.net
Fri Oct 26 11:57:27 CEST 2007


Author: niko
Date: Fri Oct 26 11:57:25 2007
New Revision: 48033

Modified:
   pypy/dist/pypy/lang/smalltalk/primitives.py
Log:
(niko, arigo)
make unwrap_spec an error



Modified: pypy/dist/pypy/lang/smalltalk/primitives.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/primitives.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/primitives.py	Fri Oct 26 11:57:25 2007
@@ -62,6 +62,9 @@
             else:
                 name = key
 
+    # Because methods always have a receiver, an unwrap_spec of [] is a bug
+    assert unwrap_spec is None or unwrap_spec
+
     def decorator(func):
         assert code not in prim_table
         func.func_name = "prim_" + name
@@ -373,8 +376,8 @@
     size = unwrap_int(w_size)
     return shadow.new(size)
 
- at expose_primitive(ARRAY_BECOME_ONE_WAY, unwrap_spec=[])
-def func(interp):
+ at expose_primitive(ARRAY_BECOME_ONE_WAY, unwrap_spec=[object, object])
+def func(interp, w_obj1, w_obj2):
     raise PrimitiveNotYetWrittenError
 
 @expose_primitive(INST_VAR_AT, unwrap_spec=[object, int])
@@ -393,8 +396,8 @@
         return subscript(idx, w_rcvr)
     raise PrimitiveFailedError()
 
- at expose_primitive(INST_VAR_AT_PUT, unwrap_spec=[])
-def func(interp):
+ at expose_primitive(INST_VAR_AT_PUT, unwrap_spec=[object])
+def func(interp, w_rcvr):
     raise PrimitiveNotYetWrittenError()
 
 @expose_primitive(AS_OOP, unwrap_spec=[object])
@@ -422,8 +425,8 @@
     # it returns the "next" instance after w_obj.
     raise PrimitiveNotYetWrittenError()
 
- at expose_primitive(NEW_METHOD, unwrap_spec=[])
-def func(interp):
+ at expose_primitive(NEW_METHOD, unwrap_spec=[object])
+def func(interp, w_mthd):
     raise PrimitiveNotYetWrittenError()
 
 # ___________________________________________________________________________
@@ -447,16 +450,16 @@
 def func(interp, w_obj):
     return w_obj.getclass()
 
- at expose_primitive(BYTES_LEFT, unwrap_spec=[])
-def func(interp):
+ at expose_primitive(BYTES_LEFT, unwrap_spec=[object])
+def func(interp, w_rcvr):
     raise PrimitiveNotYetWrittenError()
 
- at expose_primitive(QUIT, unwrap_spec=[])
-def func(interp):
+ at expose_primitive(QUIT, unwrap_spec=[object])
+def func(interp, w_rcvr):
     raise PrimitiveNotYetWrittenError()
 
- at expose_primitive(EXIT_TO_DEBUGGER, unwrap_spec=[])
-def func(interp):
+ at expose_primitive(EXIT_TO_DEBUGGER, unwrap_spec=[object])
+def func(interp, w_rcvr):
     raise PrimitiveNotYetWrittenError()
 
 @expose_primitive(CHANGE_CLASS, unwrap_spec=[object, object])



More information about the Pypy-commit mailing list