]> gitweb.factorcode.org Git - factor.git/commitdiff
python: missed a swap
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 19 Jan 2022 18:38:11 +0000 (10:38 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 19 Jan 2022 18:38:11 +0000 (10:38 -0800)
extra/python/python.factor

index 68637c3fcb0a8c012fa9f40f60260988577e3311..ee32ab8e0d95c359050136e71f4a1f281edea7a5 100644 (file)
@@ -28,11 +28,11 @@ DEFER: py>
 ! Data marshalling to Python
 : array>py-tuple ( array -- py-tuple )
     [ length <py-tuple> ] keep
-    [ [ dup ] 2dip py-tuple-set-item ] each-index ;
+    [ [ dup ] 2dip swap py-tuple-set-item ] each-index ;
 
 : vector>py-list ( vector -- py-list )
     [ length <py-list> ] keep
-    [ [ dup ] 2dip py-list-set-item ] each-index ;
+    [ [ dup ] 2dip swap py-list-set-item ] each-index ;
 
 : assoc>py-dict ( assoc -- py-dict )
     <py-dict> swap [ [ dup ] 2dip py-dict-set-item ] assoc-each ;