diff --git a/contrib/algebra/infix.factor b/contrib/algebra/infix.factor index 576eb0ccd4..ef31b358af 100644 --- a/contrib/algebra/infix.factor +++ b/contrib/algebra/infix.factor @@ -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 diff --git a/contrib/cont-responder/todo.factor b/contrib/cont-responder/todo.factor index cae2b2f0bf..44507cec33 100644 --- a/contrib/cont-responder/todo.factor +++ b/contrib/cont-responder/todo.factor @@ -56,7 +56,7 @@ USE: http : add-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 ) diff --git a/library/collections/sequences-epilogue.factor b/library/collections/sequences-epilogue.factor index 1a9f9bb7eb..8f38f28b02 100644 --- a/library/collections/sequences-epilogue.factor +++ b/library/collections/sequences-epilogue.factor @@ -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 ; diff --git a/library/io/lines.factor b/library/io/lines.factor index 5e2cb50bb0..76815ddb06 100644 --- a/library/io/lines.factor +++ b/library/io/lines.factor @@ -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 ; diff --git a/library/io/stdio.factor b/library/io/stdio.factor index 6da5211109..2562c8f0a6 100644 --- a/library/io/stdio.factor +++ b/library/io/stdio.factor @@ -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 ; diff --git a/library/ui/events.factor b/library/ui/events.factor index 5447b17e84..9065935226 100644 --- a/library/ui/events.factor +++ b/library/ui/events.factor @@ -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/ diff --git a/library/ui/hand.factor b/library/ui/hand.factor index c50599f716..957e8b5900 100644 --- a/library/ui/hand.factor +++ b/library/ui/hand.factor @@ -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, diff --git a/library/ui/hierarchy.factor b/library/ui/hierarchy.factor index 457b5e5309..fb5fd4e5fb 100644 --- a/library/ui/hierarchy.factor +++ b/library/ui/hierarchy.factor @@ -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 -- )