From 05a9338bc7fb0cc1397c3e05a23f2e59bf903bde Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 12 Aug 2005 22:02:03 +0000 Subject: [PATCH] various clean ups, fix linearization of #label --- library/alien/compiler.factor | 3 ++ library/bootstrap/boot-stage2.factor | 22 ++++++++-- library/compiler/linearizer.factor | 3 +- library/generic/tuple.factor | 45 +++++++++----------- library/inference/call-optimizers.factor | 9 +++- library/inference/words.factor | 5 ++- library/kernel.factor | 3 +- library/math/arc-trig-hyp.factor | 26 ++++++------ library/math/complex.factor | 27 ++++++------ library/math/constants.factor | 4 +- library/math/integer.factor | 6 +-- library/math/math.factor | 54 ++++++++++++------------ library/math/pow.factor | 17 ++++---- library/math/random.factor | 4 +- library/math/ratio.factor | 6 +-- library/math/trig-hyp.factor | 24 +++++------ library/syntax/parse-syntax.factor | 16 +++++-- library/syntax/see.factor | 13 ++++-- library/test/combinators.factor | 9 +++- library/test/crashes.factor | 33 --------------- library/test/errors.factor | 12 ++++++ library/test/kernel.factor | 5 +++ library/test/lists/combinators.factor | 10 ----- library/test/lists/lists.factor | 33 --------------- library/test/sequences.factor | 43 +++++++++++++++++++ library/test/strings.factor | 2 + library/test/test.factor | 7 ++- library/test/vectors.factor | 6 ++- 28 files changed, 238 insertions(+), 209 deletions(-) delete mode 100644 library/test/crashes.factor create mode 100644 library/test/kernel.factor diff --git a/library/alien/compiler.factor b/library/alien/compiler.factor index 2d04747589..97277c4254 100644 --- a/library/alien/compiler.factor +++ b/library/alien/compiler.factor @@ -159,5 +159,8 @@ M: compound (uncrossref) dup f "infer-effect" set-word-prop dup f "base-case" set-word-prop dup f "no-effect" set-word-prop + dup f "inline" set-word-prop + dup f "foldable" set-word-prop + dup f "flushable" set-word-prop decompile ] ifte ; diff --git a/library/bootstrap/boot-stage2.factor b/library/bootstrap/boot-stage2.factor index 3e3ba54c6f..df106bac85 100644 --- a/library/bootstrap/boot-stage2.factor +++ b/library/bootstrap/boot-stage2.factor @@ -1,8 +1,24 @@ ! Copyright (C) 2004, 2005 Slava Pestov. ! See http://factor.sf.net/license.txt for BSD license. -USING: alien assembler command-line compiler generic hashtables -kernel lists memory namespaces parser sequences io unparser -words ; +USING: alien assembler command-line compiler errors generic +hashtables io kernel lists memory namespaces parser sequences +unparser words ; + +: restarts. ( menu -- ) + "Restarts:" print + dup length [ unparse print ". " write first print ] 2each + "> " write flush + ; + +: try-resource ( path -- ) + "Loading " write dup print + [ + run-resource + ] [ + [ + "Error loading resource. Restarts:" print + ] when* + ] catch ; : pull-in ( ? list -- ) swap [ diff --git a/library/compiler/linearizer.factor b/library/compiler/linearizer.factor index 29cbeabdf4..8b8435fa3b 100644 --- a/library/compiler/linearizer.factor +++ b/library/compiler/linearizer.factor @@ -2,7 +2,7 @@ ! See http://factor.sf.net/license.txt for BSD license. IN: compiler-frontend USING: compiler-backend errors generic lists inference kernel -kernel-internals math namespaces prettyprint sequences +math namespaces prettyprint sequences strings words ; GENERIC: linearize-node* ( node -- ) @@ -26,7 +26,6 @@ M: #label linearize-node* ( node -- )