]> gitweb.factorcode.org Git - factor.git/commitdiff
combinators.extra: Add with-output-variable
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 1 Apr 2021 02:41:55 +0000 (21:41 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 1 Apr 2021 03:19:15 +0000 (22:19 -0500)
basis/cpu/arm/assembler/assembler.factor
extra/combinators/extras/extras.factor

index 4f686e3ae62a3dc81d8991a874f84ab7939aead7..df65689a7f67a132a4aeef38c7861eaeb940a2f3 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2020 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors combinators cpu.arm.assembler.opcodes kernel
-math math.bitwise namespaces sequences ;
+math math.bitwise namespaces sequences combinators.extras ;
 IN: cpu.arm.assembler
 
 ! pre-index mode: computed addres is the base-register + offset
@@ -106,9 +106,6 @@ ERROR: imm-out-of-range imm n ;
 : LSRi32 ( imm6 Rn Rd -- ) LSRi32-encode >out ;
 : LSRi64 ( imm6 Rn Rd -- ) LSRi64-encode >out ;
 
-: with-output-variable ( value variable quot -- value )
-    over [ get ] curry compose with-variable ; inline
-
 : with-new-arm64-offset ( offset quot -- arm64-assembler )
     [ <arm64-assembler> \ arm64-assembler ] dip with-output-variable ; inline
 
@@ -125,4 +122,4 @@ ERROR: imm-out-of-range imm n ;
     0 swap offset-test-arm64 ; inline
 
 : test-arm64-instruction ( quot -- instructions )
-    0 swap offset-test-arm64-instruction ; inline
\ No newline at end of file
+    0 swap offset-test-arm64-instruction ; inline
index eddf1c186e05e9a2978c4c3a216b03dcd5bfaf93..aaf49f1f2293938e0f10008848d57a1680407a06 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2013 Doug Coleman, John Benediktsson.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays assocs combinators combinators.smart fry
-generalizations kernel macros math quotations sequences locals
-math.order sequences.generalizations sequences.private
+generalizations kernel locals macros math math.order namespaces
+quotations sequences sequences.generalizations sequences.private
 stack-checker.transforms system words ;
 IN: combinators.extras
 
@@ -106,3 +106,6 @@ DEFER: cond*
 
 MACRO: chain ( quots -- quot )
     <reversed> [ ] [ swap '[ [ @ @ ] [ f ] if* ] ] reduce ;
+
+: with-output-variable ( value variable quot -- value )
+    over [ get ] curry compose with-variable ; inline