[pypy-svn] r26612 - pypy/dist/pypy/translator/cl
sanxiyn at codespeak.net
sanxiyn at codespeak.net
Sun Apr 30 18:11:36 CEST 2006
Author: sanxiyn
Date: Sun Apr 30 18:11:32 2006
New Revision: 26612
Modified:
pypy/dist/pypy/translator/cl/opformatter.py
Log:
ll_contains and ll_get for Dict
Modified: pypy/dist/pypy/translator/cl/opformatter.py
==============================================================================
--- pypy/dist/pypy/translator/cl/opformatter.py (original)
+++ pypy/dist/pypy/translator/cl/opformatter.py Sun Apr 30 18:11:32 2006
@@ -169,5 +169,11 @@
def ll_length(self):
return "(hash-table-count %s)" % (self.obj,)
+ def ll_contains(self, key):
+ return "(nth-value 1 (gethash %s %s))" % (key, self.obj)
+
+ def ll_get(self, key):
+ return "(gethash %s %s)" % (key, self.obj)
+
def ll_set(self, key, value):
return "(setf (gethash %s %s) %s)" % (key, self.obj, value)
More information about the Pypy-commit
mailing list