]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorU-FROGGER\erg <erg@frogger.(none)>
Sun, 3 May 2009 01:12:06 +0000 (20:12 -0500)
committerU-FROGGER\erg <erg@frogger.(none)>
Sun, 3 May 2009 01:12:06 +0000 (20:12 -0500)
86 files changed:
basis/cocoa/dialogs/dialogs.factor
basis/ftp/client/client.factor
basis/inverse/inverse-tests.factor
basis/inverse/inverse.factor
basis/io/encodings/string/string.factor
basis/io/launcher/launcher.factor
basis/io/launcher/unix/unix-tests.factor
basis/io/servers/connection/connection-tests.factor
basis/io/sockets/secure/unix/unix-tests.factor
basis/io/streams/byte-array/byte-array-tests.factor
basis/random/random.factor
basis/ui/tools/listener/listener-tests.factor
basis/xmode/code2html/code2html.factor
core/assocs/assocs.factor
core/bootstrap/primitives.factor
core/checksums/checksums.factor
core/checksums/crc32/crc32.factor
core/classes/tuple/tuple-docs.factor
core/classes/tuple/tuple.factor
core/combinators/combinators.factor
core/continuations/continuations-tests.factor
core/generic/single/single.factor
core/generic/standard/standard.factor
core/growable/growable.factor
core/hashtables/hashtables.factor
core/io/files/files.factor
core/io/io-docs.factor
core/io/io.factor
core/io/pathnames/pathnames.factor
core/io/streams/c/c-tests.factor
core/io/streams/sequence/sequence.factor
core/kernel/kernel-tests.factor
core/layouts/layouts.factor
core/lexer/lexer.factor
core/math/floats/floats-tests.factor
core/math/integers/integers-tests.factor
core/math/integers/integers.factor
core/math/math.factor
core/namespaces/namespaces.factor
core/parser/parser.factor
core/quotations/quotations.factor
core/sequences/sequences.factor
core/sorting/sorting.factor
core/splitting/splitting.factor
core/syntax/syntax-docs.factor
extra/bson/authors.txt [new file with mode: 0644]
extra/bson/constants/authors.txt [new file with mode: 0644]
extra/bson/constants/summary.txt [new file with mode: 0644]
extra/bson/reader/authors.txt [new file with mode: 0644]
extra/bson/reader/summary.txt [new file with mode: 0644]
extra/bson/summary.txt [new file with mode: 0644]
extra/bson/writer/authors.txt [new file with mode: 0644]
extra/bson/writer/summary.txt [new file with mode: 0644]
extra/contributors/contributors.factor
extra/file-trees/file-trees-tests.factor [new file with mode: 0644]
extra/file-trees/file-trees.factor [new file with mode: 0644]
extra/irc/gitbot/gitbot.factor
extra/mason/common/common.factor
extra/mongodb/authors.txt [new file with mode: 0644]
extra/mongodb/benchmark/authors.txt [new file with mode: 0644]
extra/mongodb/benchmark/summary.txt [new file with mode: 0644]
extra/mongodb/connection/authors.txt [new file with mode: 0644]
extra/mongodb/connection/summary.txt [new file with mode: 0644]
extra/mongodb/driver/driver-docs.factor
extra/mongodb/mmm/authors.txt [new file with mode: 0644]
extra/mongodb/mmm/summary.txt [new file with mode: 0644]
extra/mongodb/mongodb-docs.factor [new file with mode: 0644]
extra/mongodb/mongodb.factor [new file with mode: 0644]
extra/mongodb/msg/authors.txt [new file with mode: 0644]
extra/mongodb/msg/summary.txt [new file with mode: 0644]
extra/mongodb/operations/authors.txt [new file with mode: 0644]
extra/mongodb/operations/summary.txt [new file with mode: 0644]
extra/mongodb/summary.txt [new file with mode: 0644]
extra/mongodb/tags.txt [new file with mode: 0644]
extra/mongodb/tuple/authors.txt [new file with mode: 0644]
extra/mongodb/tuple/collection/authors.txt [new file with mode: 0644]
extra/mongodb/tuple/collection/summary.txt [new file with mode: 0644]
extra/mongodb/tuple/index/authors.txt [new file with mode: 0644]
extra/mongodb/tuple/index/summary.txt [new file with mode: 0644]
extra/mongodb/tuple/persistent/authors.txt [new file with mode: 0644]
extra/mongodb/tuple/persistent/summary.txt [new file with mode: 0644]
extra/mongodb/tuple/state/authors.txt [new file with mode: 0644]
extra/mongodb/tuple/state/summary.txt [new file with mode: 0644]
extra/mongodb/tuple/summary.txt [new file with mode: 0644]
extra/ui/frp/frp-docs.factor
extra/ui/frp/frp.factor

index 84a1ad46a3a0c1c64689b041978dfbdbfe59e03a..7761286127dcf780590cd21d9d3000605d791749 100644 (file)
@@ -12,6 +12,9 @@ IN: cocoa.dialogs
     dup 1 -> setResolvesAliases:
     dup 1 -> setAllowsMultipleSelection: ;
 
+: <NSDirPanel> ( -- panel ) <NSOpenPanel>
+   dup 1 -> setCanChooseDirectories: ;
+
 : <NSSavePanel> ( -- panel )
     NSSavePanel -> savePanel
     dup 1 -> setCanChooseFiles:
@@ -21,10 +24,12 @@ IN: cocoa.dialogs
 CONSTANT: NSOKButton 1
 CONSTANT: NSCancelButton 0
 
-: open-panel ( -- paths )
-    <NSOpenPanel>
+: (open-panel) ( panel -- paths )
     dup -> runModal NSOKButton =
     [ -> filenames CF>string-array ] [ drop f ] if ;
+    
+: open-panel ( -- paths ) <NSOpenPanel> (open-panel) ;
+: open-dir-panel ( -- paths ) <NSDirPanel> (open-panel) ;
 
 : split-path ( path -- dir file )
     "/" split1-last [ <NSString> ] bi@ ;
index 14877110d35a87a82a7116ce183a33d1ffb2207e..9d51ba259eec18fe0053d1b0769575aa3759ee06 100644 (file)
@@ -66,7 +66,7 @@ ERROR: ftp-error got expected ;
 : list ( url -- ftp-response )
     utf8 open-passive-client
     ftp-list
-    lines
+    stream-lines
     <ftp-response> swap >>strings
     read-response 226 ftp-assert
     parse-list ;
index 75e11986580329340b11d3b3041542f120b6c731..51ab6f27d9782e6b2eb04d28e285f25ff057fbfa 100644 (file)
@@ -1,5 +1,7 @@
+! Copyright (C) 2007, 2009 Daniel Ehrenberg.
+! See http://factorcode.org/license.txt for BSD license.
 USING: inverse tools.test arrays math kernel sequences
-math.functions math.constants continuations ;
+math.functions math.constants continuations combinators.smart ;
 IN: inverse-tests
 
 [ 2 ] [ { 3 2 } [ 3 swap 2array ] undo ] unit-test
@@ -69,7 +71,7 @@ C: <nil> nil
 
 [ t ] [ pi [ pi ] matches? ] unit-test
 [ 0.0 ] [ 0.0 pi + [ pi + ] undo ] unit-test
-[ ] [ 3 [ _ ] undo ] unit-test
+[ ] [ 3 [ __ ] undo ] unit-test
 
 [ 2.0 ] [ 2 3 ^ [ 3 ^ ] undo ] unit-test
 [ 3.0 ] [ 2 3 ^ [ 2 swap ^ ] undo ] unit-test
@@ -88,4 +90,7 @@ TUPLE: funny-tuple ;
 : <funny-tuple> ( -- funny-tuple ) \ funny-tuple boa ;
 : funny-tuple ( -- ) "OOPS" throw ;
 
-[ ] [ [ <funny-tuple> ] [undo] drop ] unit-test
\ No newline at end of file
+[ ] [ [ <funny-tuple> ] [undo] drop ] unit-test
+
+[ 0 ] [ { 1 2 } [ [ 1+ 2 ] { } output>sequence ] undo ] unit-test
+[ { 0 1 } ] [ 1 2 [ [ [ 1+ ] bi@ ] input<sequence ] undo ] unit-test
index 0b86b02e9206526e6d7b4b76c67556362caeecbc..4e807bd9923f18b8691cd22d4c3c9f34767f166b 100755 (executable)
@@ -1,12 +1,12 @@
-! Copyright (C) 2007, 2008 Daniel Ehrenberg.
+! Copyright (C) 2007, 2009 Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel words summary slots quotations
 sequences assocs math arrays stack-checker effects generalizations
 continuations debugger classes.tuple namespaces make vectors
 bit-arrays byte-arrays strings sbufs math.functions macros
-sequences.private combinators mirrors splitting
-combinators.short-circuit fry words.symbol generalizations ;
-RENAME: _ fry => __
+sequences.private combinators mirrors splitting combinators.smart
+combinators.short-circuit fry words.symbol generalizations
+classes ;
 IN: inverse
 
 ERROR: fail ;
@@ -14,7 +14,7 @@ M: fail summary drop "Matching failed" ;
 
 : assure ( ? -- ) [ fail ] unless ; inline
 
-: =/fail ( obj1 obj2 -- ) = assure ;
+: =/fail ( obj1 obj2 -- ) = assure ; inline
 
 ! Inverse of a quotation
 
@@ -143,14 +143,19 @@ MACRO: undo ( quot -- ) [undo] ;
 \ pick [ [ pick ] dip =/fail ] define-inverse
 \ tuck [ swapd [ =/fail ] keep ] define-inverse
 
+\ bi@ 1 [ [undo] '[ _ bi@ ] ] define-pop-inverse
+\ tri@ 1 [ [undo] '[ _ tri@ ] ] define-pop-inverse
+\ bi* 2 [ [ [undo] ] bi@ '[ _ _ bi* ] ] define-pop-inverse
+\ tri* 3 [ [ [undo] ] tri@ '[ _ _ _ tri* ] ] define-pop-inverse
+
 \ not define-involution
-\ >boolean [ { t f } memq? assure ] define-inverse
+\ >boolean [ dup { t f } memq? assure ] define-inverse
 
 \ tuple>array \ >tuple define-dual
 \ reverse define-involution
 
-\ undo 1 [ [ call ] curry ] define-pop-inverse
-\ map 1 [ [undo] [ over sequence? assure map ] curry ] define-pop-inverse
+\ undo 1 [ ] define-pop-inverse
+\ map 1 [ [undo] '[ dup sequence? assure _ map ] ] define-pop-inverse
 
 \ exp \ log define-dual
 \ sq \ sqrt define-dual
@@ -173,16 +178,13 @@ ERROR: missing-literal ;
     2curry
 ] define-pop-inverse
 
-DEFER: _
-\ _ [ drop ] define-inverse
+DEFER: __
+\ __ [ drop ] define-inverse
 
 : both ( object object -- object )
     dupd assert= ;
 \ both [ dup ] define-inverse
 
-: assure-length ( seq length -- seq )
-    over length =/fail ;
-
 {
     { >array array? }
     { >vector vector? }
@@ -194,14 +196,23 @@ DEFER: _
     { >string string? }
     { >sbuf sbuf? }
     { >quotation quotation? }
-} [ \ dup swap \ assure 3array >quotation define-inverse ] assoc-each
+} [ '[ dup _ execute assure ] define-inverse ] assoc-each
+
+: assure-length ( seq length -- )
+    swap length =/fail ; inline
+
+: assure-array ( array -- array )
+    dup array? assure ; inline
 
-! These actually work on all seqs--should they?
-\ 1array [ 1 assure-length first ] define-inverse
-\ 2array [ 2 assure-length first2 ] define-inverse
-\ 3array [ 3 assure-length first3 ] define-inverse
-\ 4array [ 4 assure-length first4 ] define-inverse
-\ narray 1 [ [ firstn ] curry ] define-pop-inverse
+: undo-narray ( array n -- ... )
+    [ assure-array ] dip
+    [ assure-length ] [ firstn ] 2bi ; inline
+
+\ 1array [ 1 undo-narray ] define-inverse
+\ 2array [ 2 undo-narray ] define-inverse
+\ 3array [ 3 undo-narray ] define-inverse
+\ 4array [ 4 undo-narray ] define-inverse
+\ narray 1 [ '[ _ undo-narray ] ] define-pop-inverse
 
 \ first [ 1array ] define-inverse
 \ first2 [ 2array ] define-inverse
@@ -214,6 +225,12 @@ DEFER: _
 \ append 1 [ [ ?tail assure ] curry ] define-pop-inverse
 \ prepend 1 [ [ ?head assure ] curry ] define-pop-inverse
 
+: assure-same-class ( obj1 obj2 -- )
+    [ class ] bi@ = assure ; inline
+
+\ output>sequence 2 [ [undo] '[ dup _ assure-same-class _ input<sequence ] ] define-pop-inverse
+\ input<sequence 1 [ [undo] '[ _ { } output>sequence ] ] define-pop-inverse
+
 ! Constructor inverse
 : deconstruct-pred ( class -- quot )
     "predicate" word-prop [ dupd call assure ] curry ;
@@ -245,7 +262,7 @@ DEFER: _
     ] recover ; inline
 
 : true-out ( quot effect -- quot' )
-    out>> '[ @ __ ndrop t ] ;
+    out>> '[ @ _ ndrop t ] ;
 
 : false-recover ( effect -- quot )
     in>> [ ndrop f ] curry [ recover-fail ] curry ;
index 5e57a943a95bb0a2d4fe80b48e17f349fc61f050..3659939fb009f508cf30cb1327f9a764a54254ec 100644 (file)
@@ -4,7 +4,7 @@ USING: io io.streams.byte-array ;
 IN: io.encodings.string
 
 : decode ( byte-array encoding -- string )
-    <byte-reader> contents ;
+    <byte-reader> stream-contents ;
 
 : encode ( string encoding -- byte-array )
     [ write ] with-byte-writer ;
index f5809223fcf1525f4217f16ada776d7f9f17b449..838c09c65738ae2061c35a4f95ca67c5ac6be3ac 100755 (executable)
@@ -3,9 +3,9 @@
 USING: system kernel namespaces strings hashtables sequences 
 assocs combinators vocabs.loader init threads continuations
 math accessors concurrency.flags destructors environment
-io io.backend io.timeouts io.pipes io.pipes.private io.encodings
-io.streams.duplex io.ports debugger prettyprint summary
-calendar ;
+io io.encodings.ascii io.backend io.timeouts io.pipes
+io.pipes.private io.encodings io.streams.duplex io.ports
+debugger prettyprint summary calendar ;
 IN: io.launcher
 
 TUPLE: process < identity-tuple
@@ -265,3 +265,5 @@ M: object run-pipeline-element
     { [ os winnt? ] [ "io.launcher.windows.nt" require ] }
     [ ]
 } cond
+
+: run-desc ( desc -- result ) ascii <process-reader> f swap stream-read-until drop ;
index f375bb41e87e05d5bf42b22ed1b3639073454894..99d45e4fd7ca0c80a40eeeef030ddd2de8347c0d 100644 (file)
@@ -33,7 +33,7 @@ concurrency.promises threads unix.process ;
     "cat"
     "launcher-test-1" temp-file
     2array
-    ascii <process-reader> contents
+    ascii <process-reader> stream-contents
 ] unit-test
 
 [ ] [
@@ -52,7 +52,7 @@ concurrency.promises threads unix.process ;
     "cat"
     "launcher-test-1" temp-file
     2array
-    ascii <process-reader> contents
+    ascii <process-reader> stream-contents
 ] unit-test
 
 [ ] [
@@ -70,14 +70,14 @@ concurrency.promises threads unix.process ;
     "cat"
     "launcher-test-1" temp-file
     2array
-    ascii <process-reader> contents
+    ascii <process-reader> stream-contents
 ] unit-test
 
 [ t ] [
     <process>
         "env" >>command
         { { "A" "B" } } >>environment
-    ascii <process-reader> lines
+    ascii <process-reader> stream-lines
     "A=B" swap member?
 ] unit-test
 
@@ -86,7 +86,7 @@ concurrency.promises threads unix.process ;
         "env" >>command
         { { "A" "B" } } >>environment
         +replace-environment+ >>environment-mode
-    ascii <process-reader> lines
+    ascii <process-reader> stream-lines
 ] unit-test
 
 [ "hi\n" ] [
@@ -113,13 +113,13 @@ concurrency.promises threads unix.process ;
     "append-test" temp-file utf8 file-contents
 ] unit-test
 
-[ t ] [ "ls" utf8 <process-stream> contents >boolean ] unit-test
+[ t ] [ "ls" utf8 <process-stream> stream-contents >boolean ] unit-test
 
 [ "Hello world.\n" ] [
     "cat" utf8 <process-stream> [
         "Hello world.\n" write
         output-stream get dispose
-        input-stream get contents
+        input-stream get stream-contents
     ] with-stream
 ] unit-test
 
index ae79290f0a014e3eeb2b0a7e604bd70305965f47..ab99531eb495666e84fa82a2035a17a81537eb39 100644 (file)
@@ -35,4 +35,4 @@ concurrency.promises io.encodings.ascii io threads calendar ;
     dup start-server* sockets>> first addr>> port>> "port" set
 ] unit-test
 
-[ "Hello world." ] [ "localhost" "port" get <inet> ascii <client> drop contents ] unit-test
+[ "Hello world." ] [ "localhost" "port" get <inet> ascii <client> drop stream-contents ] unit-test
index 7c4dcc17d1031879f8df3c30eb75a4539bca8925..f87ad93fbd59e0c1b13615f00fe26e606a2887a2 100644 (file)
@@ -23,7 +23,7 @@ io.sockets.secure.unix.debug ;
 
 : client-test ( -- string )
     <secure-config> [
-        "127.0.0.1" "port" get ?promise <inet4> <secure> ascii <client> drop contents
+        "127.0.0.1" "port" get ?promise <inet4> <secure> ascii <client> drop stream-contents
     ] with-secure-context ;
 
 [ ] [ [ class name>> write ] server-test ] unit-test
index 3cf52c6a78dc472f89aaf163619b6d889f4c776f..0cd35dfa213b11583f61ad91958703ffbe53004a 100644 (file)
@@ -6,7 +6,7 @@ io.encodings.utf8 io kernel arrays strings namespaces ;
 
 [ B{ BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 BIN: 11101111 BIN: 10000000 BIN: 10111111 BIN: 11011111 BIN: 10000000 CHAR: x } ]
 [ { BIN: 101111111000000111111 BIN: 1111000000111111 BIN: 11111000000 CHAR: x } >string utf8 [ write ] with-byte-writer ] unit-test
-[ { BIN: 101111111000000111111 } t ] [ { BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 } utf8 <byte-reader> contents dup >array swap string? ] unit-test
+[ { BIN: 101111111000000111111 } t ] [ { BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 } utf8 <byte-reader> stream-contents dup >array swap string? ] unit-test
 
 [ B{ 121 120 } 0 ] [
     B{ 0 121 120 0 0 0 0 0 0 } binary
@@ -26,4 +26,4 @@ io.encodings.utf8 io kernel arrays strings namespaces ;
         0 seek-end input-stream get stream-seek
         read1
     ] with-byte-reader
-] unit-test
\ No newline at end of file
+] unit-test
index ebde3802b458066c58ddd7e948fd7a9ec6346b95..d972e1e7ac6e454ef689721b793a3af268ed549a 100755 (executable)
@@ -54,7 +54,7 @@ PRIVATE>
 
 : randomize ( seq -- seq )
     dup length [ dup 1 > ]
-    [ [ random ] [ 1- ] bi [ pick exchange ] keep ]
+    [ [ iota random ] [ 1- ] bi [ pick exchange ] keep ]
     while drop ;
 
 : delete-random ( seq -- elt )
index 45b94344a6ff3e861d76818654fad1a403744bd8..e06e17374fa99e704e9364e00f9aa2fec8449dad 100644 (file)
@@ -75,7 +75,7 @@ CONSTANT: text "Hello world.\nThis is a test."
 [ ] [
     [
         "interactor" get register-self
-        "interactor" get contents "promise" get fulfill
+        "interactor" get stream-contents "promise" get fulfill
     ] in-thread
 ] unit-test
 
@@ -150,4 +150,4 @@ CONSTANT: text "Hello world.\nThis is a test."
 
 [ ] [ <listener-gadget> "l" set ] unit-test
 [ ] [ "l" get com-scroll-up ] unit-test
-[ ] [ "l" get com-scroll-down ] unit-test
\ No newline at end of file
+[ ] [ "l" get com-scroll-down ] unit-test
index 3fb5a532c9f8ec71e6fbb9bef468a84b0d0379f0..b5141f6cc4bbe0959fd881f7dd7a3ff390c9e9d0 100644 (file)
@@ -24,7 +24,7 @@ IN: xmode.code2html
     [XML <style><-></style> XML] ;
 
 :: htmlize-stream ( path stream -- xml )
-    stream lines
+    stream stream-lines
     [ "" ] [ path over first find-mode htmlize-lines ]
     if-empty :> input
     default-stylesheet :> stylesheet
index ec56cffff7b07f604086b0a57d7c61782002e32d..e783ef81c4d7d7328157b45ee762ffc9a24391be 100755 (executable)
@@ -32,7 +32,7 @@ M: assoc assoc-like drop ;
         3drop f
     ] [
         3dup nth-unsafe at*
-        [ [ 3drop ] dip ] [ drop [ 1- ] dip (assoc-stack) ] if
+        [ [ 3drop ] dip ] [ drop [ 1 - ] dip (assoc-stack) ] if
     ] if ; inline recursive
 
 : search-alist ( key alist -- pair/f i/f )
@@ -105,7 +105,7 @@ M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
     assoc-size 0 = ;
 
 : assoc-stack ( key seq -- value )
-    [ length 1- ] keep (assoc-stack) ; flushable
+    [ length 1 - ] keep (assoc-stack) ; flushable
 
 : assoc-subset? ( assoc1 assoc2 -- ? )
     [ at* [ = ] [ 2drop f ] if ] with-assoc assoc-all? ;
index c0d51477cab06f56891e8d7e2390fdfd326375af..ec791857541d7052f97a6265720711c0e8611bc3 100644 (file)
@@ -513,4 +513,4 @@ tuple
 } [ [ first3 ] dip swap make-primitive ] each-index
 
 ! Bump build number
-"build" "kernel" create build 1+ [ ] curry (( -- n )) define-declared
+"build" "kernel" create build 1 + [ ] curry (( -- n )) define-declared
index 98d36b21c33d89dcdccd55cc9210c7b8068fa0ae..82918b6f816890558bf7bb8a1909d4b0005cdd83 100644 (file)
@@ -13,7 +13,7 @@ GENERIC: checksum-stream ( stream checksum -- value )
 GENERIC: checksum-lines ( lines checksum -- value )
 
 M: checksum checksum-stream
-    [ contents ] dip checksum-bytes ;
+    [ stream-contents ] dip checksum-bytes ;
 
 M: checksum checksum-lines
     [ B{ CHAR: \n } join ] dip checksum-bytes ;
index 47da144d4dd6e5a3035805597c109dbf2692cc8a..7655ec84824a84e364034d6c772056a8073145b1 100644 (file)
@@ -9,7 +9,7 @@ CONSTANT: crc32-polynomial HEX: edb88320
 
 CONSTANT: crc32-table V{ }
 
-256 [
+256 iota [
     8 [
         [ 2/ ] [ even? ] bi [ crc32-polynomial bitxor ] unless
     ] times >bignum
index d76faddf15fdd9537e1eb9b16a00a1af7cbead90..4c55001aa1ec36e9061c5c98c3d31b90f97e269b 100644 (file)
@@ -254,7 +254,7 @@ ARTICLE: "tuple-examples" "Tuple examples"
     "    } ;"
     ""
     ": next-position ( role -- newrole )"
-    "    positions [ index 1+ ] keep nth ;"
+    "    positions [ index 1 + ] keep nth ;"
     ""
     ": promote ( employee -- employee )"
     "    [ 1.2 * ] change-salary"
index fb1e613b3e00a336f8807b2373d63f9c5f1be028..225176f4e5939dfaf10a629a2aa279f800935b40 100755 (executable)
@@ -165,7 +165,7 @@ ERROR: bad-superclass class ;
         {
             [ , ]
             [ [ superclass class-size ] [ "slots" word-prop length ] bi + , ]
-            [ superclasses length 1- , ]
+            [ superclasses length 1 - , ]
             [ superclasses [ [ , ] [ hashcode , ] bi ] each ]
         } cleave
     ] { } make ;
@@ -331,7 +331,7 @@ GENERIC: tuple-hashcode ( n tuple -- x )
 
 M: tuple tuple-hashcode
     [
-        [ class hashcode ] [ tuple-size ] [ ] tri
+        [ class hashcode ] [ tuple-size iota ] [ ] tri
         [ rot ] dip [
             swapd array-nth hashcode* sequence-hashcode-step
         ] 2curry each
index 1438edf3fa2dbfa88dda86389bb6edfbadec0ff4..7bf76fea30a313330eb128c2e5f9c6d99985abc7 100755 (executable)
@@ -123,7 +123,7 @@ ERROR: no-case object ;
     [ [ [ literalize ] dip ] assoc-map linear-case-quot ] with map ;
 
 : hash-dispatch-quot ( table -- quot )
-    [ length 1- [ fixnum-bitand ] curry ] keep
+    [ length 1 - [ fixnum-bitand ] curry ] keep
     [ dispatch ] curry append ;
 
 : hash-case-quot ( default assoc -- quot )
@@ -162,7 +162,7 @@ ERROR: no-case object ;
 
 ! recursive-hashcode
 : recursive-hashcode ( n obj quot -- code )
-    pick 0 <= [ 3drop 0 ] [ [ 1- ] 2dip call ] if ; inline
+    pick 0 <= [ 3drop 0 ] [ [ 1 - ] 2dip call ] if ; inline
 
 ! These go here, not in sequences and hashtables, since those
 ! two cannot depend on us
index f4eeeefb77e2910b3a4b0e147b7f819036a28900..6409fc588e9e377345ebbe2c7e399d0bcf647e4b 100644 (file)
@@ -4,7 +4,7 @@ kernel.private accessors eval ;
 IN: continuations.tests
 
 : (callcc1-test) ( n obj -- n' obj )
-    [ 1- dup ] dip ?push
+    [ 1 - dup ] dip ?push
     over 0 = [ "test-cc" get continue-with ] when
     (callcc1-test) ;
 
index 4fe9ce5a36545513ed5b291911d9a9600253896d..d8fa04edd64e3e8a1cb3e636f6341bb74cfb6946 100644 (file)
@@ -178,7 +178,7 @@ M: echelon-dispatch-engine compile-engine
 M: tuple-dispatch-engine compile-engine
     tuple assumed [
         echelons>> compile-engines
-        dup keys supremum 1+ f <array>
+        dup keys supremum 1 + f <array>
         [ <enum> swap update ] keep
     ] with-variable ;
 
@@ -253,4 +253,4 @@ M: single-combination perform-combination
         [ mega-cache-quot define ]
         [ define-inline-cache-quot ]
         2tri
-    ] with-combination ;
\ No newline at end of file
+    ] with-combination ;
index 96c273e3f8af073c764ea67fb65bf2d93e0f56ef..c8d1acba8f4a13d32a3add0f7d9e5d11ae42acbe 100644 (file)
@@ -28,7 +28,7 @@ CONSTANT: simple-combination T{ standard-combination f 0 }
         { 0 [ [ dup ] ] }
         { 1 [ [ over ] ] }
         { 2 [ [ pick ] ] }
-        [ 1- (picker) [ dip swap ] curry ]
+        [ 1 - (picker) [ dip swap ] curry ]
     } case ;
 
 M: standard-combination picker
index c4970f98bd249ec8bf905d02ff30b5e3d6e114f3..684aab115837760949281fdbf0971e364338f547 100644 (file)
@@ -35,7 +35,7 @@ M: growable set-length ( n seq -- )
     ] if
     (>>length) ;
 
-: new-size ( old -- new ) 1+ 3 * ; inline
+: new-size ( old -- new ) 1 + 3 * ; inline
 
 : ensure ( n seq -- n seq )
     growable-check
index f95a7a7e67014796ab4122aa7e251775c87acad0..0914134bb6f1b3b15c386bd0174d2bbff4911137 100644 (file)
@@ -34,7 +34,7 @@ TUPLE: hashtable
     [ no-key ] [ 2dup hash@ (key@) ] if ; inline
 
 : <hash-array> ( n -- array )
-    1+ next-power-of-2 4 * ((empty)) <array> ; inline
+    1 + next-power-of-2 4 * ((empty)) <array> ; inline
 
 : init-hash ( hash -- )
     0 >>count 0 >>deleted drop ; inline
@@ -61,10 +61,10 @@ TUPLE: hashtable
     1 fixnum+fast set-slot ; inline
 
 : hash-count+ ( hash -- )
-    [ 1+ ] change-count drop ; inline
+    [ 1 + ] change-count drop ; inline
 
 : hash-deleted+ ( hash -- )
-    [ 1+ ] change-deleted drop ; inline
+    [ 1 + ] change-deleted drop ; inline
 
 : (rehash) ( hash alist -- )
     swap [ swapd set-at ] curry assoc-each ; inline
@@ -77,7 +77,7 @@ TUPLE: hashtable
     [ deleted>> 10 fixnum*fast ] [ count>> ] bi fixnum> ; inline
 
 : grow-hash ( hash -- )
-    [ [ >alist ] [ assoc-size 1+ ] bi ] keep
+    [ [ >alist ] [ assoc-size 1 + ] bi ] keep
     [ reset-hash ] keep
     swap (rehash) ;
 
@@ -139,7 +139,7 @@ M: hashtable set-at ( value key hash -- )
 PRIVATE>
 
 M: hashtable >alist
-    [ array>> [ length 2/ ] keep ] [ assoc-size <vector> ] bi [
+    [ array>> [ length 2/ iota ] keep ] [ assoc-size <vector> ] bi [
         [
             [
                 [ 1 fixnum-shift-fast ] dip
index 1bc282e95661af65e6bad11a303a802926894e58..0f3041e67025e6b34621c894bd0427959c2084f1 100644 (file)
@@ -20,13 +20,13 @@ HOOK: (file-appender) io-backend ( path -- stream )
     swap normalize-path (file-appender) swap <encoder> ;
 
 : file-lines ( path encoding -- seq )
-    <file-reader> lines ;
+    <file-reader> stream-lines ;
 
 : with-file-reader ( path encoding quot -- )
     [ <file-reader> ] dip with-input-stream ; inline
 
 : file-contents ( path encoding -- seq )
-    <file-reader> contents ;
+    <file-reader> stream-contents ;
 
 : with-file-writer ( path encoding quot -- )
     [ <file-writer> ] dip with-output-stream ; inline
index 740152f2941420a14046046f1ef8dc0fd527031f..3469a8106477d0614eaa67dad4f6146ccb9d7aa8 100644 (file)
@@ -221,10 +221,14 @@ HELP: bl
 { $description "Outputs a space character (" { $snippet "\" \"" } ") to " { $link output-stream } "." }
 $io-error ;
 
-HELP: lines
+HELP: stream-lines
 { $values { "stream" "an input stream" } { "seq" "a sequence of strings" } }
 { $description "Reads lines of text until the stream is exhausted, collecting them in a sequence of strings." } ;
 
+HELP: lines
+{ $values { "seq" "a sequence of strings" } }
+{ $description "Reads lines of text until from the " { $link input-stream } " until it is exhausted, collecting them in a sequence of strings." } ;
+
 HELP: each-line
 { $values { "quot" { $quotation "( str -- )" } } }
 { $description "Calls the quotation with successive lines of text, until the current " { $link input-stream } " is exhausted." } ;
@@ -233,9 +237,14 @@ HELP: each-block
 { $values { "quot" { $quotation "( block -- )" } } }
 { $description "Calls the quotation with successive blocks of data, until the current " { $link input-stream } " is exhausted." } ;
 
-HELP: contents
+HELP: stream-contents
 { $values { "stream" "an input stream" } { "seq" "a string, byte array or " { $link f } } }
-{ $description "Reads the entire contents of a stream. If the stream is empty, outputs"  { $link f } "." }
+{ $description "Reads the entire contents of a stream. If the stream is empty, outputs "  { $link f } "." }
+$io-error ;
+
+HELP: contents
+{ $values { "seq" "a string, byte array or " { $link f } } }
+{ $description "Reads the entire contents of a the stream stored in " { $link input-stream } ". If the stream is empty, outputs " { $link f } "." }
 $io-error ;
 
 ARTICLE: "stream-protocol" "Stream protocol"
@@ -347,9 +356,11 @@ $nl
 "First, a simple composition of " { $link stream-write } " and " { $link stream-nl } ":"
 { $subsection stream-print }
 "Processing lines one by one:"
+{ $subsection stream-lines }
 { $subsection lines }
 { $subsection each-line }
 "Processing blocks of data:"
+{ $subsection stream-contents }
 { $subsection contents }
 { $subsection each-block }
 "Copying the contents of one stream to another:"
index 74bba7769ee48f6203c835cd7342672ed09fae53..b43098bcd4feaa83582f103d7acaec097aacaac4 100644 (file)
@@ -68,9 +68,12 @@ SYMBOL: error-stream
 
 : bl ( -- ) " " write ;
 
-: lines ( stream -- seq )
+: stream-lines ( stream -- seq )
     [ [ readln dup ] [ ] produce nip ] with-input-stream ;
 
+: lines ( -- seq )
+    input-stream get stream-lines ;
+
 <PRIVATE
 
 : each-morsel ( handler: ( data -- ) reader: ( -- data ) -- )
@@ -81,11 +84,14 @@ PRIVATE>
 : each-line ( quot -- )
     [ readln ] each-morsel ; inline
 
-: contents ( stream -- seq )
+: stream-contents ( stream -- seq )
     [
         [ 65536 read-partial dup ] [ ] produce nip concat f like
     ] with-input-stream ;
 
+: contents ( -- seq )
+    input-stream get stream-contents ;
+
 : each-block ( quot: ( block -- ) -- )
     [ 8192 read-partial ] each-morsel ; inline
 
index eba3e6a19fdb41425a34abb561abc508fbe95d56..30e9e6c2065a8e6601b875f806c8921bd18652a7 100644 (file)
@@ -17,7 +17,7 @@ SYMBOL: current-directory
     [ path-separator? ] trim-head ;
 
 : last-path-separator ( path -- n ? )
-    [ length 1- ] keep [ path-separator? ] find-last-from ;
+    [ length 1 - ] keep [ path-separator? ] find-last-from ;
 
 HOOK: root-directory? io-backend ( path -- ? )
 
@@ -30,7 +30,7 @@ ERROR: no-parent-directory path ;
     dup root-directory? [
         trim-tail-separators
         dup last-path-separator [
-            1+ cut
+            1 + cut
         ] [
             drop "." swap
         ] if
@@ -113,7 +113,7 @@ PRIVATE>
 : file-name ( path -- string )
     dup root-directory? [
         trim-tail-separators
-        dup last-path-separator [ 1+ tail ] [
+        dup last-path-separator [ 1 + tail ] [
             drop special-path? [ file-name ] when
         ] if
     ] unless ;
index 3dde9152d08eeb55624c951673debdc475e1c79d..6a82d6d5456827b2c3b6bcd43f9e1e5c19a59c1f 100644 (file)
@@ -5,6 +5,6 @@ IN: io.streams.c.tests
 [ "hello world" ] [
     "hello world" "test.txt" temp-file ascii set-file-contents
 
-    "test.txt" temp-file "rb" fopen <c-reader> contents
+    "test.txt" temp-file "rb" fopen <c-reader> stream-contents
     >string
 ] unit-test
index 0f922a37cc6421d4b264a4a93f77e0c522150518..036bab22135bd8c124b1b39f6584cc108a51c438 100644 (file)
@@ -12,7 +12,7 @@ SLOT: i
     [ i>> ] [ underlying>> ] bi ; inline
 
 : next ( stream -- )
-    [ 1+ ] change-i drop ; inline
+    [ 1 + ] change-i drop ; inline
 
 : sequence-read1 ( stream -- elt/f )
     [ >sequence-stream< ?nth ] [ next ] bi ; inline
@@ -45,4 +45,4 @@ M: growable stream-write1 push ;
 M: growable stream-write push-all ;
 M: growable stream-flush drop ;
 
-INSTANCE: growable plain-writer
\ No newline at end of file
+INSTANCE: growable plain-writer
index b58c744b057bc29a514d6a076f618dc227e6740b..5a88db4f9e0595e26fce7c28bf40f0799bfa6539 100644 (file)
@@ -114,7 +114,7 @@ IN: kernel.tests
 ! Regression
 : (loop) ( a b c d -- )
     [ pick ] dip swap [ pick ] dip swap
-    < [ [ 1+ ] 3dip (loop) ] [ 2drop 2drop ] if ; inline recursive
+    < [ [ 1 + ] 3dip (loop) ] [ 2drop 2drop ] if ; inline recursive
 
 : loop ( obj -- )
     H{ } values swap [ dup length swap ] dip 0 -roll (loop) ;
index 00b9500211818f40b7637b11581fefdec2982706..42898fc085dba73c2d64e54df916ca6ba855a972 100644 (file)
@@ -49,13 +49,13 @@ SYMBOL: mega-cache-size
     cell-bits (first-bignum) ; inline
 
 : most-positive-fixnum ( -- n )
-    first-bignum 1- ; inline
+    first-bignum 1 - ; inline
 
 : most-negative-fixnum ( -- n )
     first-bignum neg ; inline
 
 : (max-array-capacity) ( b -- n )
-    5 - 2^ 1- ; inline
+    5 - 2^ 1 - ; inline
 
 : max-array-capacity ( -- n )
     cell-bits (max-array-capacity) ; inline
@@ -64,7 +64,7 @@ SYMBOL: mega-cache-size
     bootstrap-cell-bits (first-bignum) ;
 
 : bootstrap-most-positive-fixnum ( -- n )
-    bootstrap-first-bignum 1- ;
+    bootstrap-first-bignum 1 - ;
 
 : bootstrap-most-negative-fixnum ( -- n )
     bootstrap-first-bignum neg ;
index 75341f0204d9026d14518d1ce72b23320e6901d9..60157033d7b6746e9dd55b0a7bc15cb6d072a09a 100644 (file)
@@ -9,7 +9,7 @@ TUPLE: lexer text line line-text line-length column ;
 : next-line ( lexer -- )
     dup [ line>> ] [ text>> ] bi ?nth >>line-text
     dup line-text>> length >>line-length
-    [ 1+ ] change-line
+    [ 1 + ] change-line
     0 >>column
     drop ;
 
@@ -39,7 +39,7 @@ GENERIC: skip-word ( lexer -- )
 
 M: lexer skip-word ( lexer -- )
     [
-        2dup nth CHAR: " eq? [ drop 1+ ] [ f skip ] if
+        2dup nth CHAR: " eq? [ drop 1 + ] [ f skip ] if
     ] change-lexer-column ;
 
 : still-parsing? ( lexer -- ? )
index 9f8f7b06fc5e7dc236be41cb88f52d1207c98f72..097e2c14aaad74fefb872f4cf314345e06d02ee8 100644 (file)
@@ -50,8 +50,8 @@ IN: math.floats.tests
 [ BIN: 11111111111000000000000000000000000000000000000000000000000000 bits>double ]
 unit-test
 
-[ 2.0 ] [ 1.0 1+ ] unit-test
-[ 0.0 ] [ 1.0 1- ] unit-test
+[ 2.0 ] [ 1.0 1 + ] unit-test
+[ 0.0 ] [ 1.0 1 - ] unit-test
 
 [ t ] [ 0.0 zero? ] unit-test
 [ t ] [ -0.0 zero? ] unit-test
index 6bd3e9b094cd1489176021ecd970993c141dba9e..a9469ae91a83c9dafb7606d05765d8b9fae631b3 100644 (file)
@@ -206,8 +206,8 @@ unit-test
 [ 2. ] [ 2 1 ratio>float ] unit-test
 [ .5 ] [ 1 2 ratio>float ] unit-test
 [ .75 ] [ 3 4 ratio>float ] unit-test
-[ 1. ] [ 2000 2^ 2000 2^ 1+ ratio>float ] unit-test
-[ -1. ] [ 2000 2^ neg 2000 2^ 1+ ratio>float ] unit-test
+[ 1. ] [ 2000 2^ 2000 2^ 1 + ratio>float ] unit-test
+[ -1. ] [ 2000 2^ neg 2000 2^ 1 + ratio>float ] unit-test
 [ 0.4 ] [ 6 15 ratio>float ] unit-test
 
 [ HEX: 3fe553522d230931 ]
index 868d9fc02ea2ff866616eaa2d9db2a6bdb6098d3..bb7fc107b2aec2a255f1ba1f048dcd8ff79907b3 100644 (file)
@@ -41,7 +41,7 @@ M: fixnum bitnot fixnum-bitnot ;
 M: fixnum bit? neg shift 1 bitand 0 > ;
 
 : fixnum-log2 ( x -- n )
-    0 swap [ dup 1 eq? ] [ [ 1+ ] [ 2/ ] bi* ] until drop ;
+    0 swap [ dup 1 eq? ] [ [ 1 + ] [ 2/ ] bi* ] until drop ;
 
 M: fixnum (log2) fixnum-log2 ;
 
@@ -86,7 +86,7 @@ M: bignum (log2) bignum-log2 ;
 ! provided with absolutely no warranty."
 
 ! First step: pre-scaling
-: twos ( x -- y ) dup 1- bitxor log2 ; inline
+: twos ( x -- y ) dup 1 - bitxor log2 ; inline
 
 : scale-denonimator ( den -- scaled-den scale' )
     dup twos neg [ shift ] keep ; inline
@@ -98,7 +98,7 @@ M: bignum (log2) bignum-log2 ;
 
 ! Second step: loop
 : shift-mantissa ( scale mantissa -- scale' mantissa' )
-    [ 1+ ] [ 2/ ] bi* ; inline
+    [ 1 + ] [ 2/ ] bi* ; inline
 
 : /f-loop ( scale mantissa den -- scale' fraction-and-guard rem )
     [ 2dup /i log2 53 > ]
@@ -107,7 +107,7 @@ M: bignum (log2) bignum-log2 ;
 
 ! Third step: post-scaling
 : unscaled-float ( mantissa -- n )
-    52 2^ 1- bitand 1022 52 shift bitor bits>double ; inline
+    52 2^ 1 - bitand 1022 52 shift bitor bits>double ; inline
 
 : scale-float ( scale mantissa -- float' )
     [ dup 0 < [ neg 2^ recip ] [ 2^ ] if ] dip * ; inline
@@ -126,7 +126,7 @@ M: bignum (log2) bignum-log2 ;
         ] [
             pre-scale
             /f-loop over odd?
-            [ zero? [ 1+ ] unless ] [ drop ] if
+            [ zero? [ 1 + ] unless ] [ drop ] if
             post-scale
         ] if
     ] if ; inline
index 993d8d0e76229406f613a9033829da31315eafa0..8e0000326f99e65d670ab25bf18bd05a71a06973 100755 (executable)
@@ -63,7 +63,7 @@ PRIVATE>
 : neg ( x -- -x ) 0 swap - ; inline
 : recip ( x -- y ) 1 swap / ; inline
 : sgn ( x -- n ) dup 0 < [ drop -1 ] [ 0 > 1 0 ? ] if ; inline
-: ?1+ ( x -- y ) [ 1+ ] [ 0 ] if* ; inline
+: ?1+ ( x -- y ) [ 1 + ] [ 0 ] if* ; inline
 : rem ( x y -- z ) abs [ mod ] [ + ] [ mod ] tri ; foldable
 : 2^ ( n -- 2^n ) 1 swap shift ; inline
 : even? ( n -- ? ) 1 bitand zero? ;
@@ -103,13 +103,13 @@ M: float fp-infinity? ( float -- ? )
     ] if ;
 
 : next-power-of-2 ( m -- n )
-    dup 2 <= [ drop 2 ] [ 1- log2 1+ 2^ ] if ; inline
+    dup 2 <= [ drop 2 ] [ 1 - log2 1 + 2^ ] if ; inline
 
 : power-of-2? ( n -- ? )
-    dup 0 <= [ drop f ] [ dup 1- bitand zero? ] if ; foldable
+    dup 0 <= [ drop f ] [ dup 1 - bitand zero? ] if ; foldable
 
 : align ( m w -- n )
-    1- [ + ] keep bitnot bitand ; inline
+    1 - [ + ] keep bitnot bitand ; inline
 
 <PRIVATE
 
@@ -121,7 +121,7 @@ M: float fp-infinity? ( float -- ? )
     #! Apply quot to i, keep i and quot, hide n.
     [ nip call ] 3keep ; inline
 
-: iterate-next ( i n quot -- i' n quot ) [ 1+ ] 2dip ; inline
+: iterate-next ( i n quot -- i' n quot ) [ 1 + ] 2dip ; inline
 
 PRIVATE>
 
@@ -160,6 +160,6 @@ PRIVATE>
         [ call ] 2keep rot [
             drop
         ] [
-            [ 1- ] dip find-last-integer
+            [ 1 - ] dip find-last-integer
         ] if
     ] if ; inline recursive
index 310816cbf757b226113fb31763ee5e51f6963151..64cc328d19ea90075fa5aa677b39a8edfb4132a4 100644 (file)
@@ -29,8 +29,8 @@ PRIVATE>
 : inc ( variable -- ) 1 swap +@ ; inline
 : dec ( variable -- ) -1 swap +@ ; inline
 : bind ( ns quot -- ) swap >n call ndrop ; inline
-: counter ( variable -- n ) [ 0 or 1+ dup ] change-global ;
+: counter ( variable -- n ) [ 0 or 1 + dup ] change-global ;
 : make-assoc ( quot exemplar -- hash ) 20 swap new-assoc [ swap bind ] keep ; inline
 : with-scope ( quot -- ) 5 <hashtable> swap bind ; inline
 : with-variable ( value key quot -- ) [ associate ] dip bind ; inline
-: initialize ( variable quot -- ) [ unless* ] curry change-global ; inline
\ No newline at end of file
+: initialize ( variable quot -- ) [ unless* ] curry change-global ; inline
index 7908f40cbe247378c70199c019a54bac3b5adaeb..7915dc69e092be8ac951262bd0386e8447684716 100644 (file)
@@ -272,7 +272,7 @@ print-use-hook [ [ ] ] initialize
 : parse-stream ( stream name -- quot )
     [
         [
-            lines dup parse-fresh
+            stream-lines dup parse-fresh
             [ nip ] [ finish-parsing ] 2bi
             forget-smudged
         ] with-source-file
index 2c3b41ca4e9dc444c2e3865e118171bd1530c26a..3245ac1e206bda428464352efd80422fe5489741 100644 (file)
@@ -48,12 +48,12 @@ M: object literalize ;
 
 M: wrapper literalize <wrapper> ;
 
-M: curry length quot>> length 1+ ;
+M: curry length quot>> length 1 + ;
 
 M: curry nth
     over 0 =
     [ nip obj>> literalize ]
-    [ [ 1- ] dip quot>> nth ]
+    [ [ 1 - ] dip quot>> nth ]
     if ;
 
 INSTANCE: curry immutable-sequence
index 79195d19384e1f00a32597fe1503051b02f1901e..d60602fc719893a62f07c8b8492e32e0d0759d8a 100755 (executable)
@@ -198,7 +198,7 @@ C: <reversed> reversed
 
 M: reversed virtual-seq seq>> ;
 
-M: reversed virtual@ seq>> [ length swap - 1- ] keep ;
+M: reversed virtual@ seq>> [ length swap - 1 - ] keep ;
 
 M: reversed length seq>> length ;
 
@@ -276,7 +276,7 @@ INSTANCE: repetition immutable-sequence
     ] 3keep ; inline
 
 : (copy) ( dst i src j n -- dst )
-    dup 0 <= [ 2drop 2drop ] [ 1- ((copy)) (copy) ] if ;
+    dup 0 <= [ 2drop 2drop ] [ 1 - ((copy)) (copy) ] if ;
     inline recursive
 
 : prepare-subseq ( from to seq -- dst i src j n )
@@ -460,7 +460,7 @@ PRIVATE>
     [ nip find-last-integer ] (find-from) ; inline
 
 : find-last ( seq quot -- i elt )
-    [ [ 1- ] dip find-last-integer ] (find) ; inline
+    [ [ 1 - ] dip find-last-integer ] (find) ; inline
 
 : all? ( seq quot -- ? )
     (each) all-integers? ; inline
@@ -556,7 +556,7 @@ PRIVATE>
     [ empty? not ] filter ;
 
 : mismatch ( seq1 seq2 -- i )
-    [ min-length ] 2keep
+    [ min-length iota ] 2keep
     [ 2nth-unsafe = not ] 2curry
     find drop ; inline
 
@@ -595,8 +595,8 @@ M: slice equal? over slice? [ sequence= ] [ 2drop f ] if ;
 : (filter-here) ( quot: ( elt -- ? ) store scan seq -- )
     2dup length < [
         [ move ] 3keep
-        [ nth-unsafe pick call [ 1+ ] when ] 2keep
-        [ 1+ ] dip
+        [ nth-unsafe pick call [ 1 + ] when ] 2keep
+        [ 1 + ] dip
         (filter-here)
     ] [ nip set-length drop ] if ; inline recursive
 
@@ -612,20 +612,20 @@ PRIVATE>
     [ eq? not ] with filter-here ;
 
 : prefix ( seq elt -- newseq )
-    over [ over length 1+ ] dip [
+    over [ over length 1 + ] dip [
         [ 0 swap set-nth-unsafe ] keep
         [ 1 swap copy ] keep
     ] new-like ;
 
 : suffix ( seq elt -- newseq )
-    over [ over length 1+ ] dip [
+    over [ over length 1 + ] dip [
         [ [ over length ] dip set-nth-unsafe ] keep
         [ 0 swap copy ] keep
     ] new-like ;
 
-: peek ( seq -- elt ) [ length 1- ] [ nth ] bi ;
+: peek ( seq -- elt ) [ length 1 - ] [ nth ] bi ;
 
-: pop* ( seq -- ) [ length 1- ] [ shorten ] bi ;
+: pop* ( seq -- ) [ length 1 - ] [ shorten ] bi ;
 
 <PRIVATE
 
@@ -633,7 +633,7 @@ PRIVATE>
     2over = [
         2drop 2drop
     ] [
-        [ [ 2over + pick ] dip move [ 1+ ] dip ] keep
+        [ [ 2over + pick ] dip move [ 1 + ] dip ] keep
         move-backward
     ] if ;
 
@@ -641,13 +641,13 @@ PRIVATE>
     2over = [
         2drop 2drop
     ] [
-        [ [ pick [ dup dup ] dip + swap ] dip move 1- ] keep
+        [ [ pick [ dup dup ] dip + swap ] dip move 1 - ] keep
         move-forward
     ] if ;
 
 : (open-slice) ( shift from to seq ? -- )
     [
-        [ [ 1- ] bi@ ] dip move-forward
+        [ [ 1 - ] bi@ ] dip move-forward
     ] [
         [ over - ] 2dip move-backward
     ] if ;
@@ -667,7 +667,7 @@ PRIVATE>
     check-slice [ over [ - ] dip ] dip open-slice ;
 
 : delete-nth ( n seq -- )
-    [ dup 1+ ] dip delete-slice ;
+    [ dup 1 + ] dip delete-slice ;
 
 : snip ( from to seq -- head tail )
     [ swap head ] [ swap tail ] bi-curry bi* ; inline
@@ -679,10 +679,10 @@ PRIVATE>
     snip-slice surround ;
 
 : remove-nth ( n seq -- seq' )
-    [ [ { } ] dip dup 1+ ] dip replace-slice ;
+    [ [ { } ] dip dup 1 + ] dip replace-slice ;
 
 : pop ( seq -- elt )
-    [ length 1- ] [ [ nth ] [ shorten ] 2bi ] bi ;
+    [ length 1 - ] [ [ nth ] [ shorten ] 2bi ] bi ;
 
 : exchange ( m n seq -- )
     [ nip bounds-check 2drop ]
@@ -692,7 +692,7 @@ PRIVATE>
 
 : reverse-here ( seq -- )
     [ length 2/ ] [ length ] [ ] tri
-    [ [ over - 1- ] dip exchange-unsafe ] 2curry each ;
+    [ [ over - 1 - ] dip exchange-unsafe ] 2curry each ;
 
 : reverse ( seq -- newseq )
     [
@@ -799,7 +799,7 @@ PRIVATE>
 PRIVATE>
 
 : start* ( subseq seq n -- i )
-    pick length pick length swap - 1+
+    pick length pick length swap - 1 +
     [ (start) ] find-from
     swap [ 3drop ] dip ;
 
index 30ecb70ed9f4335219bf05445411b01eb37459da..f2fa6b8771542826c235e8b37df3f99741fd3b97 100644 (file)
@@ -29,13 +29,13 @@ TUPLE: merge
     [ [ [ 2drop ] dip nth-unsafe ] dip push ] [
         pick 2 = [
             [
-                [ 2drop dup 1+ ] dip
+                [ 2drop dup 1 + ] dip
                 [ nth-unsafe ] curry bi@
             ] dip [ push ] curry bi@
         ] [
             pick 3 = [
                 [
-                    [ 2drop dup 1+ dup 1+ ] dip
+                    [ 2drop dup 1 + dup 1 + ] dip
                     [ nth-unsafe ] curry tri@
                 ] dip [ push ] curry tri@
             ] [ [ nip subseq ] dip push-all ] if
@@ -57,10 +57,10 @@ TUPLE: merge
     [ [ from2>> ] [ to2>> ] [ seq>> ] tri ] [ accum>> ] bi dump ; inline
 
 : l-next ( merge -- )
-    [ [ l-elt ] [ [ 1+ ] change-from1 drop ] bi ] [ accum>> ] bi push ; inline
+    [ [ l-elt ] [ [ 1 + ] change-from1 drop ] bi ] [ accum>> ] bi push ; inline
 
 : r-next ( merge -- )
-    [ [ r-elt ] [ [ 1+ ] change-from2 drop ] bi ] [ accum>> ] bi push ; inline
+    [ [ r-elt ] [ [ 1 + ] change-from2 drop ] bi ] [ accum>> ] bi push ; inline
 
 : decide ( merge -- ? )
     [ [ l-elt ] [ r-elt ] bi ] dip call +gt+ eq? ; inline
@@ -129,8 +129,8 @@ TUPLE: merge
     while 2drop ; inline
 
 : each-pair ( seq quot -- )
-    [ [ length 1+ 2/ ] keep ] dip
-    [ [ 1 shift dup 1+ ] dip ] prepose curry each-integer ; inline
+    [ [ length 1 + 2/ ] keep ] dip
+    [ [ 1 shift dup 1 + ] dip ] prepose curry each-integer ; inline
 
 : (sort-pairs) ( i1 i2 seq quot accum -- )
     [ 2dup length = ] 2dip rot [
index 6d833c792e86b17ea5b3dc513f0dba643c65b5e7..c55a75baa69de923a7f25134833553f7cdea46df 100644 (file)
@@ -55,7 +55,7 @@ PRIVATE>
 
 : (split) ( separators n seq -- )
     3dup rot [ member? ] curry find-from drop
-    [ [ swap subseq , ] 2keep 1+ swap (split) ]
+    [ [ swap subseq , ] 2keep 1 + swap (split) ]
     [ swap dup zero? [ drop ] [ tail ] if , drop ] if* ; inline recursive
 
 : split, ( seq separators -- ) 0 rot (split) ;
index e8f86faa9d8defe9f48ac2d0bef6ae37fee19de8..fff355fb951e6a34316eb2e47fadb14837d7d3d8 100644 (file)
@@ -749,7 +749,7 @@ HELP: <PRIVATE
         "<PRIVATE"
         ""
         ": (fac) ( accum n -- n! )"
-        "    dup 1 <= [ drop ] [ [ * ] keep 1- (fac) ] if ;"
+        "    dup 1 <= [ drop ] [ [ * ] keep 1 - (fac) ] if ;"
         ""
         "PRIVATE>"
         ""
@@ -760,7 +760,7 @@ HELP: <PRIVATE
         "IN: factorial.private"
         ""
         ": (fac) ( accum n -- n! )"
-        "    dup 1 <= [ drop ] [ [ * ] keep 1- (fac) ] if ;"
+        "    dup 1 <= [ drop ] [ [ * ] keep 1 - (fac) ] if ;"
         ""
         "IN: factorial"
         ""
diff --git a/extra/bson/authors.txt b/extra/bson/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/bson/constants/authors.txt b/extra/bson/constants/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/bson/constants/summary.txt b/extra/bson/constants/summary.txt
new file mode 100644 (file)
index 0000000..11b0592
--- /dev/null
@@ -0,0 +1 @@
+Shared constants and classes
diff --git a/extra/bson/reader/authors.txt b/extra/bson/reader/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/bson/reader/summary.txt b/extra/bson/reader/summary.txt
new file mode 100644 (file)
index 0000000..384fe07
--- /dev/null
@@ -0,0 +1 @@
+BSON to Factor deserializer
diff --git a/extra/bson/summary.txt b/extra/bson/summary.txt
new file mode 100644 (file)
index 0000000..58604e6
--- /dev/null
@@ -0,0 +1 @@
+BSON reader and writer
diff --git a/extra/bson/writer/authors.txt b/extra/bson/writer/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/bson/writer/summary.txt b/extra/bson/writer/summary.txt
new file mode 100644 (file)
index 0000000..5dc8501
--- /dev/null
@@ -0,0 +1 @@
+Factor to BSON serializer
index 1879c52826035660476ec8fb72ae773d5932d481..73bee76c0a693afe59d87ef521a83b5bdb8b044b 100755 (executable)
@@ -7,7 +7,7 @@ IN: contributors
 
 : changelog ( -- authors )
     image parent-directory [
-        "git log --pretty=format:%an" ascii <process-reader> lines
+        "git log --pretty=format:%an" ascii <process-reader> stream-lines
     ] with-directory ;
 
 : patch-counts ( authors -- assoc )
diff --git a/extra/file-trees/file-trees-tests.factor b/extra/file-trees/file-trees-tests.factor
new file mode 100644 (file)
index 0000000..dbb8f9f
--- /dev/null
@@ -0,0 +1,4 @@
+USING: kernel file-trees ;
+IN: file-trees.tests
+{ "/sample/1" "/sample/2" "/killer/1" "/killer/2/3"
+"/killer/2/4" "/killer/2/4/6" "/megakiller" } create-tree drop
\ No newline at end of file
diff --git a/extra/file-trees/file-trees.factor b/extra/file-trees/file-trees.factor
new file mode 100644 (file)
index 0000000..788291c
--- /dev/null
@@ -0,0 +1,23 @@
+USING: accessors delegate delegate.protocols io.pathnames
+kernel locals namespaces sequences vectors
+tools.annotations prettyprint ;
+IN: file-trees
+
+TUPLE: tree node children ;
+CONSULT: sequence-protocol tree children>> [ node>> ] map ;
+
+: <tree> ( start -- tree ) V{ } clone
+   [ tree boa dup children>> ] [ ".." swap tree boa ] bi swap push ;
+
+DEFER: (tree-insert)
+
+: tree-insert ( path tree -- ) [ unclip <tree> ] [ children>> ] bi* (tree-insert) ;
+:: (tree-insert) ( path-rest path-head tree-children -- )
+   tree-children [ node>> path-head node>> = ] find nip
+   [ path-rest swap tree-insert ]
+   [ 
+      path-head tree-children push
+      path-rest [ path-head tree-insert ] unless-empty
+   ] if* ;
+: create-tree ( file-list -- tree ) [ path-components ] map
+   t <tree> [ [ tree-insert ] curry each ] keep ;
\ No newline at end of file
index d145b3bd2c447861c04d1101d3644d3ce79a4f5e..161a81d555cca122d66373cedcd1941b82246e5d 100644 (file)
@@ -33,7 +33,7 @@ M: object handle-message drop ;
         "--pretty=format:%h %an: %s" ,
         ".." glue ,
     ] { } make
-    latin1 [ input-stream get lines ] with-process-reader ;
+    latin1 [ lines ] with-process-reader ;
 
 : updates ( from to -- lines )
     git-log reverse
index 285a684f0659993167239f349579391483c4b6df..b255b351f0cb613368a48d4d2f57ed87209c3a04 100755 (executable)
@@ -16,7 +16,7 @@ M: output-process-error error.
 
 : try-output-process ( command -- )
     >process +stdout+ >>stderr utf8 <process-reader*>
-    [ contents ] [ dup wait-for-process ] bi*
+    [ stream-contents ] [ dup wait-for-process ] bi*
     0 = [ 2drop ] [ output-process-error ] if ;
 
 HOOK: really-delete-tree os ( path -- )
diff --git a/extra/mongodb/authors.txt b/extra/mongodb/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/benchmark/authors.txt b/extra/mongodb/benchmark/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/benchmark/summary.txt b/extra/mongodb/benchmark/summary.txt
new file mode 100644 (file)
index 0000000..5d0e4f5
--- /dev/null
@@ -0,0 +1 @@
+serialization/deserialization and insert/query benchmarks for mongodb.driver
diff --git a/extra/mongodb/connection/authors.txt b/extra/mongodb/connection/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/connection/summary.txt b/extra/mongodb/connection/summary.txt
new file mode 100644 (file)
index 0000000..44cfb3f
--- /dev/null
@@ -0,0 +1 @@
+low-level connection handling for mongodb.driver
index 1086105306e5b352962f8b3f9ed7a83f9d0322e5..7dbf564df943e8d7de3795fe570fa71c281de393 100644 (file)
@@ -280,9 +280,4 @@ HELP: with-db
 }
 { $description "executes a quotation with the given mdb instance in its context" } ;
 
-ARTICLE: "mongodb.driver" "MongoDB factor driver"
-{ $vocab-link "mongodb.driver" }
-;
-
-ABOUT: "mongodb.driver"
 
diff --git a/extra/mongodb/mmm/authors.txt b/extra/mongodb/mmm/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/mmm/summary.txt b/extra/mongodb/mmm/summary.txt
new file mode 100644 (file)
index 0000000..0670873
--- /dev/null
@@ -0,0 +1 @@
+mongo-message-monitor - a small proxy to introspect messages send to MongoDB
diff --git a/extra/mongodb/mongodb-docs.factor b/extra/mongodb/mongodb-docs.factor
new file mode 100644 (file)
index 0000000..ff8a769
--- /dev/null
@@ -0,0 +1,27 @@
+USING: assocs help.markup help.syntax kernel quotations ;
+IN: mongodb
+
+ARTICLE: "mongodb" "MongoDB factor integration"
+"The " { $vocab-link "mongodb" } " vocabulary provides two different interfaces to the MongoDB document-oriented database"
+{ $heading "Low-level driver" }
+"The " { $vocab-link "mongodb.driver" } " vocabulary provides a low-level interface to MongoDB."
+{ $unchecked-example
+  "USING: mongodb.driver ;"
+  "\"db\" \"127.0.0.1\" 27017 <mdb>"
+  "[ \"mycollection\" [ H{ { \"name\" \"Alfred\" } { \"age\" 57 } } save ] "
+  "                 [ ageIdx [ \"age\" asc ] key-spec <index-spec> ensure-index ]"
+  "                 [ H{ { \"age\" H{ { \"$gt\" 50 } } } } <query> find-one ] tri ] with-db "
+  "" }
+{ $heading "Highlevel tuple integration" }
+"The " { $vocab-link "mongodb.tuple" } " vocabulary lets you define persistent tuples that can be stored to and retrieved from a MongoDB database"
+{ $unchecked-example
+  "USING: mongodb.driver mongodb.tuple fry ;"
+  "MDBTUPLE: person name age ; "
+  "person \"persons\" { { \"age\" +fieldindex+ } } define-persistent "
+  "\"db\" \"127.0.0.1\" 27017 <mdb>"
+  "person new \"Alfred\" >>name 57 >>age"
+  "'[ _ save-tuple person new 57 >>age select-tuple ] with-db"
+  "" }
+;
+
+ABOUT: "mongodb"
\ No newline at end of file
diff --git a/extra/mongodb/mongodb.factor b/extra/mongodb/mongodb.factor
new file mode 100644 (file)
index 0000000..c5417cc
--- /dev/null
@@ -0,0 +1,8 @@
+USING: vocabs.loader ;
+
+IN: mongodb
+
+"mongodb.connection" require
+"mongodb.driver" require
+"mongodb.tuple" require
+
diff --git a/extra/mongodb/msg/authors.txt b/extra/mongodb/msg/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/msg/summary.txt b/extra/mongodb/msg/summary.txt
new file mode 100644 (file)
index 0000000..daff8c2
--- /dev/null
@@ -0,0 +1 @@
+message primitives for the communication with MongoDB
diff --git a/extra/mongodb/operations/authors.txt b/extra/mongodb/operations/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/operations/summary.txt b/extra/mongodb/operations/summary.txt
new file mode 100644 (file)
index 0000000..ab9f94e
--- /dev/null
@@ -0,0 +1 @@
+low-level message reading and writing
diff --git a/extra/mongodb/summary.txt b/extra/mongodb/summary.txt
new file mode 100644 (file)
index 0000000..87c5b2d
--- /dev/null
@@ -0,0 +1 @@
+MongoDB Factor integration
diff --git a/extra/mongodb/tags.txt b/extra/mongodb/tags.txt
new file mode 100644 (file)
index 0000000..aa0d57e
--- /dev/null
@@ -0,0 +1 @@
+database
diff --git a/extra/mongodb/tuple/authors.txt b/extra/mongodb/tuple/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/tuple/collection/authors.txt b/extra/mongodb/tuple/collection/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/tuple/collection/summary.txt b/extra/mongodb/tuple/collection/summary.txt
new file mode 100644 (file)
index 0000000..e568b51
--- /dev/null
@@ -0,0 +1 @@
+tuple class MongoDB collection handling
diff --git a/extra/mongodb/tuple/index/authors.txt b/extra/mongodb/tuple/index/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/tuple/index/summary.txt b/extra/mongodb/tuple/index/summary.txt
new file mode 100644 (file)
index 0000000..e4a1549
--- /dev/null
@@ -0,0 +1 @@
+tuple class index handling
diff --git a/extra/mongodb/tuple/persistent/authors.txt b/extra/mongodb/tuple/persistent/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/tuple/persistent/summary.txt b/extra/mongodb/tuple/persistent/summary.txt
new file mode 100644 (file)
index 0000000..46f32e4
--- /dev/null
@@ -0,0 +1 @@
+tuple to MongoDB storable conversion (and back)
diff --git a/extra/mongodb/tuple/state/authors.txt b/extra/mongodb/tuple/state/authors.txt
new file mode 100644 (file)
index 0000000..5df962b
--- /dev/null
@@ -0,0 +1 @@
+Sascha Matzke
diff --git a/extra/mongodb/tuple/state/summary.txt b/extra/mongodb/tuple/state/summary.txt
new file mode 100644 (file)
index 0000000..f879133
--- /dev/null
@@ -0,0 +1 @@
+client-side persistent tuple state handling
diff --git a/extra/mongodb/tuple/summary.txt b/extra/mongodb/tuple/summary.txt
new file mode 100644 (file)
index 0000000..6c79de2
--- /dev/null
@@ -0,0 +1 @@
+persist tuple instances into MongoDB
index a6f625cc59958934544339d74ed4b935b192e532..af44567e4621720ea3f8ea401a19b51c1384e962 100644 (file)
@@ -1,36 +1,46 @@
-USING: ui.frp help.syntax help.markup monads sequences ;
+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: <hbox>
+{ $values { "gadgets" "a list of gadgets" } { "track" track } }
 { $syntax "[ gadget , gadget , ... ] <hbox>" }
 { $description "Creates an horizontal track containing the gadgets listed in the quotation" } ;
 HELP: <vbox>
+{ $values { "gadgets" "a list of gadgets" } { "track" track } }
 { $syntax "[ gadget , gadget , ... ] <hbox>" }
 { $description "Creates an vertical track containing the gadgets listed in the quotation" } ;
 
 ! Gadgets
 HELP: <frp-button>
+{ $values { "text" "the button's label" } { "button" button } }
 { $description "Creates an button whose model updates on clicks" } ;
 
 HELP: <merge>
-{ $description "Creates a model that merges the updates of two others" } ;
+{ $values { "models" "a list of models" } { "model" merge-model } }
+{ $description "Creates a model that merges the updates of others" } ;
 
 HELP: <filter>
+{ $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: <fold>
+{ $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: switch
+{ $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." ;
+"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." ;
 
index f5c0f1bd107a2ddc023b5b6711cbe2072b686571..aa7c44ee0384d6aca863a3a0b4aea7326f246ef9 100644 (file)
@@ -14,11 +14,12 @@ M: frp-table row-columns quot>> [ call( a -- b ) ] [ drop f ] if* ;
 M: frp-table row-value val-quot>> [ call( a -- b ) ]  [ drop f ] if* ;
 M: frp-table row-color color-quot>> [ call( a -- b ) ]  [ drop f ] if* ;
 
-: <frp-table> ( model quot -- table )
-    frp-table new-line-gadget dup >>renderer swap >>quot swap >>model
+: <frp-table> ( model -- table )
+    frp-table new-line-gadget dup >>renderer [ ] >>quot swap >>model
     f <model> >>selected-value sans-serif-font >>font
     focus-border-color >>focus-border-color
     transparent >>column-line-color ;
+: <frp-list> ( model -- table ) <frp-table> [ 1array ] >>quot ;
 : <frp-field> ( -- field ) f <model> <model-field> ;
 
 ! Layout utilities
@@ -27,11 +28,11 @@ GENERIC: output-model ( gadget -- model )
 M: gadget output-model model>> ;
 M: frp-table output-model selected-value>> ;
 
-GENERIC: , ( object -- )
+GENERIC: , ( uiitem -- )
 M: gadget , make:, ;
 M: model , activate-model ;
 
-GENERIC: -> ( object -- model )
+GENERIC: -> ( uiitem -- model )
 M: gadget -> dup make:, output-model ;
 M: model -> dup , ;
 M: table -> dup , selected-value>> ;