diff --git a/core/bootstrap/stage2.factor b/core/bootstrap/stage2.factor index 121dd815e3..1a52781307 100755 --- a/core/bootstrap/stage2.factor +++ b/core/bootstrap/stage2.factor @@ -19,7 +19,7 @@ IN: bootstrap.stage2 parse-command-line - H{ } clone changed-words set-global + all-words [ dup ] H{ } map>assoc changed-words set-global "-no-crossref" cli-args member? [ "Cross-referencing..." print flush @@ -41,9 +41,6 @@ IN: bootstrap.stage2 ] if [ - ! Compile everything if compiler is loaded - all-words [ changed-word ] each - "exclude" "include" [ get-global " " split [ empty? not ] subset ] 2apply seq-diff diff --git a/core/io/files/files.factor b/core/io/files/files.factor index 84d83bd052..da1c078525 100644 --- a/core/io/files/files.factor +++ b/core/io/files/files.factor @@ -29,9 +29,8 @@ M: object root-directory? ( path -- ? ) "/" = ; "/\\" member? ; : path+ ( str1 str2 -- str ) - >r [ path-separator? ] rtrim r> - [ path-separator? ] ltrim - >r "/" r> 3append ; + >r [ path-separator? ] right-trim "/" r> + [ path-separator? ] left-trim 3append ; : stat ( path -- directory? permissions length modified ) normalize-pathname (stat) ; diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index 58250f1ee5..1509fa8c05 100755 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -236,9 +236,11 @@ unit-test [ -1./0. 0 delete-nth ] unit-test-fails [ "" ] [ "" [ blank? ] trim ] unit-test -[ "" ] [ "" [ blank? ] ltrim ] unit-test -[ "" ] [ "" [ blank? ] rtrim ] unit-test +[ "" ] [ "" [ blank? ] left-trim ] unit-test +[ "" ] [ "" [ blank? ] right-trim ] unit-test +[ "" ] [ " " [ blank? ] left-trim ] unit-test +[ "" ] [ " " [ blank? ] right-trim ] unit-test [ "asdf" ] [ " asdf " [ blank? ] trim ] unit-test -[ "asdf " ] [ " asdf " [ blank? ] ltrim ] unit-test -[ " asdf" ] [ " asdf " [ blank? ] rtrim ] unit-test +[ "asdf " ] [ " asdf " [ blank? ] left-trim ] unit-test +[ " asdf" ] [ " asdf " [ blank? ] right-trim ] unit-test diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 778f688c86..dedbbfc59d 100755 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -652,16 +652,16 @@ PRIVATE> dup slice? [ { } like ] when 0 over length rot ; inline -: ltrim ( seq quot -- newseq ) - over >r [ not ] compose find drop - r> swap [ tail ] when* ; inline +: left-trim ( seq quot -- newseq ) + over >r [ not ] compose find drop r> swap + [ tail ] [ dup length tail ] if* ; inline -: rtrim ( seq quot -- newseq ) - over >r [ not ] compose find-last drop - r> swap [ 1+ head ] when* ; inline +: right-trim ( seq quot -- newseq ) + over >r [ not ] compose find-last drop r> swap + [ 1+ head ] [ 0 head ] if* ; inline : trim ( seq quot -- newseq ) - [ ltrim ] keep rtrim ; inline + [ left-trim ] keep right-trim ; inline : sum ( seq -- n ) 0 [ + ] reduce ; : product ( seq -- n ) 1 [ * ] reduce ; diff --git a/extra/benchmark/raytracer/raytracer.factor b/extra/benchmark/raytracer/raytracer.factor index 8f447bcb69..b277b08d79 100644 --- a/extra/benchmark/raytracer/raytracer.factor +++ b/extra/benchmark/raytracer/raytracer.factor @@ -2,7 +2,7 @@ ! http://www.ffconsultancy.com/free/ray_tracer/languages.html USING: float-arrays compiler generic io io.files kernel math -math.vectors math.parser namespaces sequences +math.functions math.vectors math.parser namespaces sequences sequences.private words ; IN: benchmark.raytracer diff --git a/extra/benchmark/spectral-norm/spectral-norm.factor b/extra/benchmark/spectral-norm/spectral-norm.factor index 196f06142e..e67359e70c 100644 --- a/extra/benchmark/spectral-norm/spectral-norm.factor +++ b/extra/benchmark/spectral-norm/spectral-norm.factor @@ -1,7 +1,7 @@ ! Factor port of ! http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=all -USING: float-arrays kernel math math.vectors sequences -sequences.private prettyprint words tools.time hints ; +USING: float-arrays kernel math math.functions math.vectors +sequences sequences.private prettyprint words tools.time hints ; IN: benchmark.spectral-norm : fast-truncate >fixnum >float ; inline diff --git a/extra/boids/ui/ui.factor b/extra/boids/ui/ui.factor index 2bd86f49f6..15f33796fa 100644 --- a/extra/boids/ui/ui.factor +++ b/extra/boids/ui/ui.factor @@ -1,6 +1,7 @@ USING: kernel namespaces math + math.functions math.vectors math.parser hashtables sequences threads diff --git a/extra/calendar/calendar.factor b/extra/calendar/calendar.factor index 27857e0d9f..59414a1142 100644 --- a/extra/calendar/calendar.factor +++ b/extra/calendar/calendar.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: arrays hashtables io io.streams.string kernel math -math.vectors math.parser +math.vectors math.functions math.parser namespaces sequences strings tuples system ; IN: calendar diff --git a/extra/color-picker/color-picker.factor b/extra/color-picker/color-picker.factor index 7082afc822..62ea2e29ba 100644 --- a/extra/color-picker/color-picker.factor +++ b/extra/color-picker/color-picker.factor @@ -1,8 +1,9 @@ ! Copyright (C) 2006, 2007 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel math math.parser models sequences ui ui.gadgets -ui.gadgets.controls ui.gadgets.frames ui.gadgets.labels -ui.gadgets.packs ui.gadgets.sliders ui.render ; +USING: kernel math math.functions math.parser models sequences +ui ui.gadgets ui.gadgets.controls ui.gadgets.frames +ui.gadgets.labels ui.gadgets.packs ui.gadgets.sliders ui.render +; IN: color-picker ! Simple example demonstrating the use of models. diff --git a/extra/colors/hsv/hsv.factor b/extra/colors/hsv/hsv.factor index 102f45ce8a..79919d2d02 100644 --- a/extra/colors/hsv/hsv.factor +++ b/extra/colors/hsv/hsv.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2007 Eduardo Cavazos ! See http://factorcode.org/license.txt for BSD license. -USING: kernel combinators arrays sequences math combinators.lib ; +USING: kernel combinators arrays sequences math math.functions +combinators.lib ; IN: colors.hsv diff --git a/extra/crypto/sha1/sha1.factor b/extra/crypto/sha1/sha1.factor index 3497e33915..dfc5b10f7a 100644 --- a/extra/crypto/sha1/sha1.factor +++ b/extra/crypto/sha1/sha1.factor @@ -127,7 +127,7 @@ SYMBOL: K : file>sha1 ( file -- sha1 ) stream>sha1 ; : string>sha1-interleave ( string -- ) - [ zero? ] ltrim + [ zero? ] left-trim dup length odd? [ 1 tail ] when seq>2seq [ string>sha1 ] 2apply swap 2seq>seq ; diff --git a/extra/factory/commands/commands.factor b/extra/factory/commands/commands.factor index 35fab82ea8..282c738976 100644 --- a/extra/factory/commands/commands.factor +++ b/extra/factory/commands/commands.factor @@ -1,5 +1,5 @@ -USING: kernel combinators sequences math math.vectors mortar slot-accessors +USING: kernel combinators sequences math math.functions math.vectors mortar slot-accessors x x.widgets.wm.root x.widgets.wm.frame combinators.lib ; IN: factory.commands diff --git a/extra/io/windows/nt/backend/backend.factor b/extra/io/windows/nt/backend/backend.factor index a7f803fd7f..0cbdabfa1e 100755 --- a/extra/io/windows/nt/backend/backend.factor +++ b/extra/io/windows/nt/backend/backend.factor @@ -32,7 +32,7 @@ M: windows-nt-io normalize-pathname ( string -- string ) dup first CHAR: \\ = [ CHAR: \\ , ] unless % ] "" make ] } - } cond [ "/\\." member? ] rtrim ; + } cond [ "/\\." member? ] right-trim ; SYMBOL: io-hash diff --git a/extra/io/windows/windows.factor b/extra/io/windows/windows.factor index 423783526e..f46af26568 100644 --- a/extra/io/windows/windows.factor +++ b/extra/io/windows/windows.factor @@ -17,7 +17,7 @@ M: windows-io (socket-destructor) ( obj -- ) destructor-obj closesocket drop ; M: windows-io root-directory? ( path -- ? ) - [ path-separator? ] rtrim + [ path-separator? ] right-trim dup length 2 = [ dup first Letter? swap second CHAR: : = and diff --git a/extra/irc/irc.factor b/extra/irc/irc.factor index 0f2f2c371a..6f54768cab 100644 --- a/extra/irc/irc.factor +++ b/extra/irc/irc.factor @@ -72,7 +72,7 @@ TUPLE: part-command channel text ; SYMBOL: irc-client : irc-stream> ( -- stream ) irc-client get irc-client-stream ; -: trim-: ( seq -- seq ) [ CHAR: : = ] ltrim ; +: trim-: ( seq -- seq ) [ CHAR: : = ] left-trim ; : parse-name ( string -- string ) trim-: "!" split first ; : irc-split ( string -- seq ) diff --git a/extra/math/fft/fft.factor b/extra/math/fft/fft.factor index a21351fa74..6b5215350c 100644 --- a/extra/math/fft/fft.factor +++ b/extra/math/fft/fft.factor @@ -9,7 +9,7 @@ IN: math.fft : odd ( seq -- seq ) 2 group 1 ; DEFER: fft : two ( seq -- seq ) fft 2 v/n dup append ; -: omega ( n -- n ) recip -2 pi i * * * exp ; +: omega ( n -- n ) recip -2 pi i* * * exp ; : twiddle ( seq -- seq ) dup length dup omega swap n^v v* ; : (fft) ( seq -- seq ) dup odd two twiddle swap even two v+ ; : fft ( seq -- seq ) dup length 1 = [ (fft) ] unless ; diff --git a/extra/math/polynomials/polynomials.factor b/extra/math/polynomials/polynomials.factor index 5a4cc2bc66..f805df8249 100644 --- a/extra/math/polynomials/polynomials.factor +++ b/extra/math/polynomials/polynomials.factor @@ -22,7 +22,7 @@ PRIVATE> : p= ( p p -- ? ) pextend = ; : ptrim ( p -- p ) - dup length 1 = [ [ zero? ] rtrim ] unless ; + dup length 1 = [ [ zero? ] right-trim ] unless ; : 2ptrim ( p p -- p p ) [ ptrim ] 2apply ; : p+ ( p p -- p ) pextend v+ ; diff --git a/extra/pack/pack.factor b/extra/pack/pack.factor index 07b572f801..fd39f83a98 100644 --- a/extra/pack/pack.factor +++ b/extra/pack/pack.factor @@ -88,7 +88,7 @@ M: string b, ( n string -- ) heap-size b, ; "\0" read-until [ drop f ] unless ; : read-c-string* ( n -- str/f ) - read [ 0 = ] rtrim dup empty? [ drop f ] when ; + read [ 0 = ] right-trim dup empty? [ drop f ] when ; : (read-128-ber) ( n -- n ) 1 read first diff --git a/extra/parser-combinators/parser-combinators.factor b/extra/parser-combinators/parser-combinators.factor index 97acf8398b..fa0733f321 100644 --- a/extra/parser-combinators/parser-combinators.factor +++ b/extra/parser-combinators/parser-combinators.factor @@ -111,11 +111,11 @@ M: or-parser (parse) ( input parser1 -- list ) #! input. This implements the choice parsing operator. [ or-parser-p1 ] keep or-parser-p2 >r dupd parse swap r> parse lappend ; -: ltrim-slice ( string -- string ) +: left-trim-slice ( string -- string ) #! Return a new string without any leading whitespace #! from the original string. dup empty? [ - dup first blank? [ 1 tail-slice ltrim-slice ] when + dup first blank? [ 1 tail-slice left-trim-slice ] when ] unless ; TUPLE: sp-parser p1 ; @@ -127,7 +127,7 @@ C: sp sp-parser ( p1 -- parser ) M: sp-parser (parse) ( input parser -- list ) #! Skip all leading whitespace from the input then call #! the parser on the remaining input. - >r ltrim-slice r> sp-parser-p1 parse ; + >r left-trim-slice r> sp-parser-p1 parse ; TUPLE: just-parser p1 ; diff --git a/extra/pos/pos.factor b/extra/pos/pos.factor index 3071ebcf5f..24c5410e99 100644 --- a/extra/pos/pos.factor +++ b/extra/pos/pos.factor @@ -1,5 +1,5 @@ -USING: kernel math math.vectors sequences self ; +USING: kernel math math.functions math.vectors sequences self ; IN: pos diff --git a/extra/tar/tar.factor b/extra/tar/tar.factor index e41264680c..01a50566b4 100644 --- a/extra/tar/tar.factor +++ b/extra/tar/tar.factor @@ -164,7 +164,7 @@ TUPLE: unimplemented-typeflag header ; ! Long file name : typeflag-L ( header -- ) [ read-data-blocks ] keep - >string [ CHAR: \0 = ] rtrim filename set + >string [ CHAR: \0 = ] right-trim filename set global [ "long filename: " write filename get . flush ] bind filename get tar-path+ make-directories ; diff --git a/extra/tetris/game/game.factor b/extra/tetris/game/game.factor index 869a7c49c2..74c2f5f1cb 100644 --- a/extra/tetris/game/game.factor +++ b/extra/tetris/game/game.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006, 2007 Alex Chapman ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences math tetris.board tetris.piece -tetris.tetromino lazy-lists combinators system ; +USING: kernel sequences math math.functions tetris.board +tetris.piece tetris.tetromino lazy-lists combinators system ; IN: tetris.game TUPLE: tetris pieces last-update update-interval rows score game-state paused? running? ; diff --git a/misc/integration/deploy-size-test.factor b/misc/integration/deploy-size-test.factor new file mode 100644 index 0000000000..91cdaba293 --- /dev/null +++ b/misc/integration/deploy-size-test.factor @@ -0,0 +1,28 @@ +USING: tools.deploy sequences io.files io.launcher io +kernel concurrency prettyprint ; + +"." resource-path cd + +"deploy-log" make-directory + +{ + "automata.ui" + "boids.ui" + "bunny" + "color-picker" + "gesture-logger" + "golden-section" + "hello-world" + "hello-ui" + "lsys.ui" + "maze" + "nehe" + "tetris" + "catalyst-talk" +} [ + dup + "deploy-log/" over append + [ deploy ] with-stream + dup file-length 1024 /f + 2array +] parallel-map . diff --git a/misc/integration/macosx-deploy.factor b/misc/integration/macosx-deploy.factor index 29642a08eb..f1e6e7fe06 100644 --- a/misc/integration/macosx-deploy.factor +++ b/misc/integration/macosx-deploy.factor @@ -3,7 +3,7 @@ kernel concurrency ; "." resource-path cd -"mkdir deploy-log" run-process +"deploy-log" make-directory { "automata.ui"