Author: Juergen Boemmels <[email protected]>
Branch: 
Changeset: r28:ebb0242d9706
Date: 2011-12-03 17:52 +0100
http://bitbucket.org/pypy/lang-scheme/changeset/ebb0242d9706/

Log:    Add another helper function

diff --git a/scheme/object.py b/scheme/object.py
--- a/scheme/object.py
+++ b/scheme/object.py
@@ -634,6 +634,18 @@
 
     return w_cdr
 
+def lst2plst(w_list):
+    """coverts W_Pair scheme list into a python list() of W_Root"""
+    lst = []
+    w_iter = w_list
+    while w_iter is not w_nil:
+        if not isinstance(w_iter, W_Pair):
+            raise WrongArg(w_list, "List")
+        lst.append(w_iter.car)
+        w_iter = w_iter.cdr
+
+    return lst
+
 ##
 # Continuations
 ##
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to