diff --git a/library/bootstrap/boot-stage2.factor b/library/bootstrap/boot-stage2.factor index b6277c5d6f..64b347a900 100644 --- a/library/bootstrap/boot-stage2.factor +++ b/library/bootstrap/boot-stage2.factor @@ -5,8 +5,8 @@ kernel-internals listener math memory namespaces optimizer parser sequences sequences-internals words ; [ - ! Wrap everything in a catch which starts a listener so you can - ! see what went wrong, instead of dealing with a fep + ! Wrap everything in a catch which starts a listener so you + ! can see what went wrong, instead of dealing with a fep [ "Cross-referencing..." print flush H{ } clone changed-words set-global @@ -20,11 +20,28 @@ parser sequences sequences-internals words ; ] when "compile" get [ + \ number= compile + \ + compile + \ nth compile + \ set-nth compile + \ = compile + + ! Load UI backend + "cocoa" get [ + "/library/compiler/alien/objc/load.factor" run-resource + "/library/ui/cocoa/load.factor" run-resource + ] when + + "x11" get [ + "/library/ui/x11/load.factor" run-resource + ] when + windows? [ "/library/windows/load.factor" run-resource "/library/ui/windows/load.factor" run-resource ] when - + + ! Load native I/O code "native-io" get [ unix? [ "/library/io/unix/load.factor" run-resource @@ -36,35 +53,11 @@ parser sequences sequences-internals words ; parse-command-line - "Compiling base..." print flush - - [ - \ number= compile - \ + compile - \ nth compile - \ set-nth compile - \ = compile - { "kernel" "sequences" "assembler" } compile-vocabs - - "Compiling system..." print flush - compile-all - ] with-class [ with-classclass ( n -- class ) builtins get nth ; : predicate-word ( word -- predicate ) @@ -31,7 +32,7 @@ SYMBOL: builtins : superclass ( class -- super ) "superclass" word-prop ; -: members "members" word-prop ; +: members ( class -- seq ) "members" word-prop ; : (flatten-class) ( class -- ) dup members [ [ (flatten-class) ] each ] [ dup set ] ?if ; @@ -69,22 +70,8 @@ DEFER: (class<) { [ t ] [ union-class< ] } } cond ; -SYMBOL: classhash - ] map>hash nip ; - -: with-classhash ] keep + classhash ] unit-test +[ H{ } ] [ { } [ dup ] map>hash ] unit-test [ ] [ 1000 [ dup sq ] map>hash "testhash" set ] unit-test @@ -199,11 +199,6 @@ H{ } clone "cache-test" set [ { 1 3 } ] [ H{ { 2 2 } } { 1 2 3 } remove-all ] unit-test -[ H{ } ] [ { } hash-concat ] unit-test -[ H{ } ] [ { H{ } } hash-concat ] unit-test -[ H{ { 1 2 } } ] [ { H{ { 1 2 } } } hash-concat ] unit-test -[ H{ { 1 2 } { 3 4 } } ] [ { H{ { 1 2 } } H{ { 3 4 } } } hash-concat ] unit-test - ! Resource leak... H{ } "x" set 100 [ drop "x" get clear-hash ] each diff --git a/library/test/generic.factor b/library/test/generic.factor index 261874814f..755d9148f4 100644 --- a/library/test/generic.factor +++ b/library/test/generic.factor @@ -56,33 +56,28 @@ M: very-funny gooey sq ; [ 1/4 ] [ 1/2 gooey ] unit-test -: classfloat ] ] [ \ float \ integer math-upgrade ] unit-test [ number ] [ \ number \ float math-class-max ] unit-test [ float ] [ \ real \ float math-class-max ] unit-test + +TUPLE: forget-class-test ; +[ t ] [ forget-class-test tuple classstring + { "a" "b" } { "c" "d" } effect>string ] unit-test [ "( -- c d )" ] [ - { { } { "c" "d" } } effect>string + { } { "c" "d" } effect>string ] unit-test [ "( a b -- )" ] [ - { { "a" "b" } { } } effect>string + { "a" "b" } { } effect>string ] unit-test [ "( -- )" ] [ - { { } { } } effect>string + { } { } effect>string ] unit-test [ ] [ \ fixnum see ] unit-test diff --git a/library/test/redefine.factor b/library/test/redefine.factor index 6b9617a9a0..039ee30723 100644 --- a/library/test/redefine.factor +++ b/library/test/redefine.factor @@ -2,8 +2,8 @@ USING: compiler definitions generic hashtables inference math namespaces parser test words ; IN: temporary -DEFER: foo -DEFER: bar +DEFER: foo \ foo reset-generic +DEFER: bar \ bar reset-generic [ ] [ \ foo [ 1 2 ] define-compound ] unit-test [ { 0 2 } ] [ [ foo ] infer ] unit-test