diff --git a/extra/drills/deployed/deploy.factor b/extra/drills/deployed/deploy.factor index eaa0d3bb69..c1e93078f7 100644 --- a/extra/drills/deployed/deploy.factor +++ b/extra/drills/deployed/deploy.factor @@ -1,14 +1,14 @@ USING: tools.deploy.config ; H{ - { deploy-unicode? f } - { deploy-threads? t } - { deploy-math? t } { deploy-name "drills" } - { deploy-ui? t } + { deploy-c-types? t } { "stop-after-last-window?" t } - { deploy-word-props? f } - { deploy-c-types? f } - { deploy-io 2 } - { deploy-word-defs? f } - { deploy-reflection 1 } + { deploy-unicode? t } + { deploy-threads? t } + { deploy-reflection 6 } + { deploy-word-defs? t } + { deploy-math? t } + { deploy-ui? t } + { deploy-word-props? t } + { deploy-io 3 } } diff --git a/extra/drills/deployed/deployed.factor b/extra/drills/deployed/deployed.factor index 43873c99bb..5681c73438 100644 --- a/extra/drills/deployed/deployed.factor +++ b/extra/drills/deployed/deployed.factor @@ -1,11 +1,11 @@ -USING: accessors arrays cocoa.dialogs combinators continuations +USING: arrays cocoa.dialogs combinators continuations fry grouping io.encodings.utf8 io.files io.styles kernel math math.parser models models.arrow models.history namespaces random sequences splitting ui ui.gadgets.alerts ui.gadgets.book-extras ui.gadgets.books ui.gadgets.buttons ui.gadgets.frames ui.gadgets.grids ui.gadgets.labels ui.gadgets.tracks fonts wrap.strings system ; - +EXCLUDE: accessors => change-model ; IN: drills.deployed SYMBOLS: it startLength ; : big ( gadget -- gadget ) T{ font { name "sans-serif" } { size 30 } } >>font ; diff --git a/extra/drills/drills.factor b/extra/drills/drills.factor index 9ee4e9b6eb..8251851511 100644 --- a/extra/drills/drills.factor +++ b/extra/drills/drills.factor @@ -1,10 +1,11 @@ -USING: accessors arrays cocoa.dialogs combinators continuations +USING: arrays cocoa.dialogs combinators continuations fry grouping io.encodings.utf8 io.files io.styles kernel math math.parser models models.arrow models.history namespaces random sequences splitting ui ui.gadgets.alerts ui.gadgets.book-extras ui.gadgets.books ui.gadgets.buttons ui.gadgets.frames ui.gadgets.grids ui.gadgets.labels ui.gadgets.tracks fonts wrap.strings ; +EXCLUDE: accessors => change-model ; IN: drills SYMBOLS: it startLength ; diff --git a/extra/merger/deploy.factor b/extra/merger/deploy.factor index adaab737c3..39a73eab82 100644 --- a/extra/merger/deploy.factor +++ b/extra/merger/deploy.factor @@ -1,14 +1,14 @@ USING: tools.deploy.config ; H{ - { deploy-math? t } - { deploy-io 2 } - { deploy-unicode? t } + { deploy-name "Merger" } { deploy-c-types? f } { "stop-after-last-window?" t } - { deploy-ui? t } - { deploy-reflection 1 } - { deploy-name "Merger" } - { deploy-word-props? f } + { deploy-unicode? f } { deploy-threads? t } + { deploy-reflection 1 } { deploy-word-defs? f } + { deploy-math? t } + { deploy-ui? t } + { deploy-word-props? f } + { deploy-io 2 } } diff --git a/extra/merger/merger.factor b/extra/merger/merger.factor index c4986bf47f..ee9207e4ca 100644 --- a/extra/merger/merger.factor +++ b/extra/merger/merger.factor @@ -1,4 +1,5 @@ -USING: accessors arrays fry io.directories kernel models sequences sets ui +USING: accessors arrays fry io.directories kernel +models sequences sets ui ui.gadgets ui.gadgets.buttons ui.gadgets.labeled ui.gadgets.tracks ui.gadgets.labels ui.gadgets.glass math.rectangles cocoa.dialogs ; diff --git a/extra/ui/frp/gadgets/gadgets.factor b/extra/ui/frp/gadgets/gadgets.factor index 08c7b44002..f80ecf55dc 100644 --- a/extra/ui/frp/gadgets/gadgets.factor +++ b/extra/ui/frp/gadgets/gadgets.factor @@ -21,7 +21,7 @@ M: frp-table row-color color-quot>> [ call( a -- b ) ] [ drop f ] if* ; : ( model -- table ) f frp-table new-table dup >>renderer V{ } clone >>selected-values V{ } clone >>selected-indices* ; : ( -- table ) V{ } clone ; -: ( model -- table ) [ 1array ] >>quot ; +: ( column-model -- table ) [ 1array ] >>quot ; : ( -- table ) V{ } clone ; : indexed ( table -- table ) f >>val-quot ; diff --git a/extra/ui/frp/signals/signals.factor b/extra/ui/frp/signals/signals.factor index c7c9736111..8dc87a7fbb 100644 --- a/extra/ui/frp/signals/signals.factor +++ b/extra/ui/frp/signals/signals.factor @@ -10,25 +10,25 @@ M: multi-model model-activated dup dependencies>> dup length 1 = TUPLE: basic-model < multi-model ; M: basic-model (model-changed) [ value>> ] dip set-model ; -: ( models -- model ) basic-model ; -: ( value -- model ) basic-model new-model ; +: ( models -- signal ) basic-model ; +: ( value -- signal ) basic-model new-model ; TUPLE: filter-model < multi-model quot ; M: filter-model (model-changed) [ value>> ] dip 2dup quot>> call( a -- ? ) [ set-model ] [ 2drop ] if ; -: ( model quot -- filter-model ) [ 1array filter-model ] dip >>quot ; +: ( model quot -- filter-signal ) [ 1array filter-model ] dip >>quot ; TUPLE: fold-model < multi-model oldval quot ; M: fold-model (model-changed) [ [ value>> ] [ [ oldval>> ] [ quot>> ] bi ] bi* call( val oldval -- newval ) ] keep set-model ; -: ( oldval quot model -- model' ) 1array fold-model swap >>quot +: ( oldval quot model -- signal ) 1array fold-model swap >>quot swap [ >>oldval ] [ >>value ] bi ; TUPLE: updater-model < multi-model values updates ; M: updater-model (model-changed) tuck updates>> = [ [ values>> value>> ] keep set-model ] [ drop ] if ; -: ( values updates -- updater ) [ 2array updater-model ] 2keep +: ( values updates -- signal ) [ 2array updater-model ] 2keep [ >>values ] [ >>updates ] bi* ; TUPLE: switch-model < multi-model original switcher on ; @@ -41,20 +41,20 @@ M: switch-model model-activated [ original>> ] keep model-changed ; : >behavior ( event -- behavior ) t swap ; TUPLE: mapped-model < multi-model model quot ; -: new-mapped-model ( model quot class -- const-model ) [ over 1array ] dip +: new-mapped-model ( model quot class -- mapped-model ) [ over 1array ] dip swap >>quot swap >>model ; -: ( model quot -- mapped ) mapped-model new-mapped-model ; +: ( model quot -- signal ) mapped-model new-mapped-model ; M: mapped-model (model-changed) [ [ value>> ] [ quot>> ] bi* call( old -- new ) ] [ nip ] 2bi set-model ; TUPLE: side-effect-model < mapped-model ; M: side-effect-model (model-changed) [ [ value>> ] [ quot>> ] bi* call( old -- ) ] keep t swap set-model ; -: $> ( model quot -- side-effect-model ) side-effect-model new-mapped-model ; +: $> ( model quot -- signal ) side-effect-model new-mapped-model ; TUPLE: quot-model < mapped-model ; M: quot-model (model-changed) nip [ quot>> call( -- b ) ] keep set-model ; -: <$ ( model quot -- quot-model ) quot-model new-mapped-model ; +: <$ ( model quot -- signal ) quot-model new-mapped-model ; TUPLE: action-value < basic-model parent ; : ( parent value -- model ) action-value new-model swap >>parent ; @@ -63,7 +63,7 @@ M: action-value model-activated dup parent>> dup activate-model model-changed ; TUPLE: action < multi-model quot ; M: action (model-changed) [ [ value>> ] [ quot>> ] bi* call( a -- b ) ] keep value>> [ swap add-connection ] 2keep model-changed ; -: ( model quot -- action ) [ 1array action ] dip >>quot dup f >>value value>> ; +: ( model quot -- action-signal ) [ 1array action ] dip >>quot dup f >>value value>> ; TUPLE: | < multi-model ; : <|> ( models -- product ) | ; diff --git a/extra/ui/frp/xfrp-docs.factor b/extra/ui/frp/xfrp-docs.factor deleted file mode 100644 index fb63d7f1b9..0000000000 --- a/extra/ui/frp/xfrp-docs.factor +++ /dev/null @@ -1,46 +0,0 @@ -USING: help.markup help.syntax models monads sequences -ui.gadgets.buttons ui.gadgets.tracks ; -IN: ui.frp - -! Layout utilities - -HELP: , -{ $values { "uiitem" "a gadget or model" } } -{ $description "Used in a series of gadgets created by a box, accumulating the gadget" } ; -HELP: -> -{ $values { "uiitem" "a gadget or model" } { "model" model } } -{ $description "Like " { $link , } "but passes its model on for further use." } ; -HELP: -{ $values { "gadgets" "a list of gadgets" } { "track" track } } -{ $syntax "[ gadget , gadget , ... ] " } -{ $description "Creates an horizontal track containing the gadgets listed in the quotation" } ; -HELP: -{ $values { "gadgets" "a list of gadgets" } { "track" track } } -{ $syntax "[ gadget , gadget , ... ] " } -{ $description "Creates an vertical track containing the gadgets listed in the quotation" } ; - -! Gadgets -HELP: -{ $values { "text" "the button's label" } { "button" button } } -{ $description "Creates an button whose model updates on clicks" } ; - -HELP: -{ $values { "models" "a list of models" } { "model" basic-model } } -{ $description "Creates a model that merges the updates of others" } ; - -HELP: -{ $values { "model" model } { "quot" "quotation with stack effect ( a b -- c )" } { "filter-model" filter-model } } -{ $description "Creates a model that uses the updates of another model when they satisfy a given predicate" } ; - -HELP: -{ $values { "oldval" "starting value" } { "quot" "applied to update and previous values" } { "model" model } { "model'" model } } -{ $description "Similar to " { $link reduce } " but works on models, applying a quotation to the previous and new values at each update" } ; - -HELP: -{ $values { "signal1" model } { "signal2" model } { "signal'" model } } -{ $description "Creates a model that starts with the behavior of model1 and switches to the behavior of model2 on its update" } ; - -ARTICLE: { "frp" "instances" } "FRP Instances" -"Models are all functors, as " { $link fmap } " corresponds directly to the " { $link "models.arrow" } " vocabulary. " -"Also, a gadget is a monad. Binding recieves a model and creates a new gadget." ; -