]> gitweb.factorcode.org Git - factor.git/commitdiff
new add word, got rid of unused stdio-stream
authorSlava Pestov <slava@factorcode.org>
Thu, 23 Jun 2005 19:53:54 +0000 (19:53 +0000)
committerSlava Pestov <slava@factorcode.org>
Thu, 23 Jun 2005 19:53:54 +0000 (19:53 +0000)
contrib/algebra/infix.factor
contrib/cont-responder/todo.factor
library/collections/sequences-epilogue.factor
library/io/lines.factor
library/io/stdio.factor
library/ui/events.factor
library/ui/hand.factor
library/ui/hierarchy.factor

index 576eb0ccd431e5e2563f535b69ed199be2d9c07b..ef31b358af8f9d6d09b369a44bcca98c14a16bc3 100644 (file)
@@ -90,7 +90,7 @@ M: list3 (eval-infix)
     swap-in-infix \ dup swons swap append ;
 
 M: list2 (eval-infix)
-    2unlist swapd (eval-infix) swap arith-1 word-prop unit append ;
+    2unlist swapd (eval-infix) swap arith-1 word-prop add ;
 
 : build-prefix ( num-of-vars -- quote )
     #! What needs to be placed in front of the eval-infix quote
index cae2b2f0bf0c24f87825fed8395f8317f13e5e6e..44507cec33b054a30d55a5a2a62fbff5c984314d 100644 (file)
@@ -56,7 +56,7 @@ USE: http
 : add-todo-item ( <todo> <item> -- )
   #! Add the item to the todo list
   swap [
-    "items" get swap unit append "items" set
+    "items" get swap add "items" set
   ] bind ;
 
 : >yes/no ( bool -- str )
index 1a9f9bb7eba149b443983db850d0930cc8a32754..8f38f28b029aa926bb9a92b95bf303f795715301 100644 (file)
@@ -96,9 +96,13 @@ M: object contains? ( obj seq -- ? )
     [ over push ] each drop ;
 
 : append ( s1 s2 -- s1+s2 )
-    #! Return a new sequence of the same type as s1.
+    #! Outputs a new sequence of the same type as s1.
     swap [ swap nappend ] immutable ;
 
+: add ( seq elt -- seq )
+    #! Outputs a new sequence of the same type as seq.
+    unit append ;
+
 : append3 ( s1 s2 s3 -- s1+s2+s3 )
     #! Return a new sequence of the same type as s1.
     rot [ [ rot nappend ] keep swap nappend ] immutable ;
index 5e2cb50bb0ed32a2826b816049567cbf7668c985..76815ddb069381510fb07ae33755276e3ef7b6f4 100644 (file)
@@ -30,9 +30,11 @@ M: line-reader stream-readln ( line -- string )
 
 M: line-reader stream-read ( count line -- string )
     [ delegate stream-read ] keep dup cr> [
-        over empty?
-        [ drop ]
-        [ >r 1 swap tail r> stream-read1 [ append ] when* ] ifte
+        over empty? [
+            drop
+        ] [
+            >r 1 swap tail r> stream-read1 [ add ] when*
+        ] ifte
     ] [
         drop
     ] ifte ;
index 6da52111091ad597b3457240e2022aaf910f471c..2562c8f0a6324f0138bec7c1e56b813c65fa9c4c 100644 (file)
@@ -29,8 +29,3 @@ USING: errors kernel lists namespaces generic strings ;
         swap stdio set
         [ [ close rethrow ] when* ] catch
     ] with-scope ;
-
-TUPLE: stdio-stream ;
-C: stdio-stream ( stream -- stream ) [ set-delegate ] keep ;
-M: stdio-stream stream-auto-flush ( -- ) delegate stream-flush ;
-M: stdio-stream stream-close ( -- ) drop ;
index 5447b17e8420a18946b916b2a2999e8f87abe671..906593522660afc1fd33d206ab483aae92d9de8a 100644 (file)
@@ -19,7 +19,7 @@ M: resize-event handle-event ( event -- )
     world get relayout ;
 
 : button-gesture ( button gesture -- )
-    swap unit append hand hand-clicked handle-gesture drop ;
+    swap add hand hand-clicked handle-gesture drop ;
 
 M: button-down-event handle-event ( event -- )
     button-event-button dup hand button/
index c50599f7169134decef25e61868c69b0dd6a2fe3..957e8b590082bad331d8e9711806089436e698dd 100644 (file)
@@ -78,7 +78,7 @@ C: hand ( world -- hand )
 
 : motion-gesture ( hand gadget gesture -- )
     #! Send a gesture like [ drag 2 ].
-    rot hand-buttons car unit append swap handle-gesture drop ;
+    rot hand-buttons car add swap handle-gesture drop ;
 
 : fire-motion ( hand -- )
     #! Fire a motion gesture to the gadget underneath the hand,
index 457b5e5309e727e4ca05a07d5d6a7d2ae89e8810..fb5fd4e5fba7b21a9ee38e83c42061e5647c4aa1 100644 (file)
@@ -11,7 +11,7 @@ sequences ;
 
 : (add-gadget) ( gadget box -- )
     #! This is inefficient.
-    [ gadget-children swap unit append ] keep
+    [ gadget-children swap add ] keep
     set-gadget-children ;
 
 : unparent ( gadget -- )