]> gitweb.factorcode.org Git - factor.git/commitdiff
Untangling some dependencies
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 8 Dec 2008 20:58:00 +0000 (14:58 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 8 Dec 2008 20:58:00 +0000 (14:58 -0600)
67 files changed:
basis/alien/prettyprint/prettyprint.factor [new file with mode: 0644]
basis/alien/syntax/syntax.factor
basis/bit-arrays/bit-arrays.factor
basis/bit-vectors/bit-vectors.factor
basis/bootstrap/bootstrap-error.factor [new file with mode: 0644]
basis/bootstrap/compiler/compiler.factor
basis/bootstrap/finish-bootstrap.factor [new file with mode: 0644]
basis/bootstrap/finish-staging.factor [new file with mode: 0644]
basis/bootstrap/math/math.factor
basis/bootstrap/stage2.factor
basis/byte-vectors/byte-vectors.factor
basis/checksums/md5/md5.factor
basis/checksums/openssl/openssl.factor
basis/checksums/sha1/sha1.factor
basis/checksums/stream/stream.factor [new file with mode: 0644]
basis/command-line/command-line.factor
basis/compiler/cfg/alias-analysis/alias-analysis-tests.factor
basis/compiler/cfg/dead-code/dead-code-tests.factor
basis/compiler/cfg/debugger/debugger.factor
basis/compiler/cfg/registers/registers.factor
basis/compiler/cfg/value-numbering/value-numbering-tests.factor
basis/compiler/cfg/write-barrier/write-barrier-tests.factor
basis/compiler/codegen/fixup/fixup.factor
basis/compiler/compiler.factor
basis/compiler/tree/debugger/debugger.factor
basis/debugger/debugger.factor
basis/help/definitions/definitions.factor
basis/help/lint/lint.factor
basis/io/styles/styles.factor
basis/locals/locals.factor
basis/math/complex/complex.factor
basis/math/complex/prettyprint/prettyprint.factor [new file with mode: 0644]
basis/nibble-arrays/nibble-arrays.factor
basis/persistent/hashtables/hashtables.factor
basis/persistent/vectors/vectors.factor
basis/prettyprint/backend/backend-docs.factor
basis/prettyprint/backend/backend.factor
basis/prettyprint/custom/custom-docs.factor [new file with mode: 0644]
basis/prettyprint/custom/custom.factor [new file with mode: 0644]
basis/prettyprint/prettyprint-docs.factor
basis/prettyprint/prettyprint.factor
basis/qualified/qualified.factor
basis/regexp/regexp.factor
basis/specialized-arrays/functor/functor.factor
basis/specialized-vectors/functor/functor.factor
basis/stack-checker/backend/backend.factor
basis/stack-checker/errors/errors.factor
basis/stack-checker/errors/prettyprint/prettyprint.factor [new file with mode: 0644]
basis/stack-checker/known-words/known-words.factor
basis/summary/summary.factor
basis/tools/deploy/backend/backend.factor
basis/tools/deploy/config/config-docs.factor
basis/tools/deploy/config/config.factor
basis/tools/deploy/config/editor/editor-docs.factor [new file with mode: 0644]
basis/tools/deploy/config/editor/editor.factor [new file with mode: 0644]
basis/tools/deploy/deploy-docs.factor
basis/tools/deploy/shaker/shaker.factor
basis/tools/disassembler/disassembler-tests.factor
basis/urls/urls.factor
basis/vlists/vlists.factor
core/bootstrap/primitives.factor
core/bootstrap/stage1.factor
core/bootstrap/syntax.factor
core/checksums/checksums.factor
core/classes/algebra/algebra-docs.factor
core/growable/growable-docs.factor
core/syntax/syntax.factor

diff --git a/basis/alien/prettyprint/prettyprint.factor b/basis/alien/prettyprint/prettyprint.factor
new file mode 100644 (file)
index 0000000..0794ab7
--- /dev/null
@@ -0,0 +1,14 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel combinators alien alien.strings alien.syntax
+prettyprint.backend prettyprint.custom prettyprint.sections ;
+IN: alien.prettyprint
+
+M: alien pprint*
+    {
+        { [ dup expired? ] [ drop \ BAD-ALIEN pprint-word ] }
+        { [ dup pinned-c-ptr? not ] [ drop "( displaced alien )" text ] }
+        [ \ ALIEN: [ alien-address pprint* ] pprint-prefix ]
+    } cond ;
+
+M: dll pprint* dll-path dup "DLL\" " "\"" pprint-string ;
index d10c97cd3ddd15033bd57dcf066e4c1eba48608f..b0ba10a316176e501699e8487a993e168d50f482 100644 (file)
@@ -3,8 +3,7 @@
 USING: accessors arrays alien alien.c-types alien.structs
 alien.arrays alien.strings kernel math namespaces parser
 sequences words quotations math.parser splitting grouping
-effects prettyprint prettyprint.sections prettyprint.backend
-assocs combinators lexer strings.parser alien.parser ;
+effects assocs combinators lexer strings.parser alien.parser ;
 IN: alien.syntax
 
 : DLL" lexer get skip-blank parse-string dlopen parsed ; parsing
@@ -34,12 +33,3 @@ IN: alien.syntax
     dup length
     [ [ create-in ] dip 1quotation define ] 2each ;
     parsing
-
-M: alien pprint*
-    {
-        { [ dup expired? ] [ drop \ BAD-ALIEN pprint-word ] }
-        { [ dup pinned-c-ptr? not ] [ drop "( displaced alien )" text ] }
-        [ \ ALIEN: [ alien-address pprint* ] pprint-prefix ]
-    } cond ;
-
-M: dll pprint* dll-path dup "DLL\" " "\"" pprint-string ;
index 4cb2032f4f27e8434dc3a8182a0c5efd9501ef79..d5e94f02389ea664eb1f48925d38aa027a4c0551 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types accessors math alien.accessors kernel
 kernel.private locals sequences sequences.private byte-arrays
-parser prettyprint.backend fry ;
+parser prettyprint.custom fry ;
 IN: bit-arrays
 
 TUPLE: bit-array
index 404b26829b332b1f4d39ab8e4ec2713c1457ea79..85bea80b2dbadc239747c2a20fa22d65314a5c4e 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.\r
 ! See http://factorcode.org/license.txt for BSD license.\r
 USING: arrays kernel kernel.private math sequences\r
-sequences.private growable bit-arrays prettyprint.backend\r
+sequences.private growable bit-arrays prettyprint.custom\r
 parser accessors ;\r
 IN: bit-vectors\r
 \r
diff --git a/basis/bootstrap/bootstrap-error.factor b/basis/bootstrap/bootstrap-error.factor
new file mode 100644 (file)
index 0000000..01eb002
--- /dev/null
@@ -0,0 +1,8 @@
+USING: continuations kernel io debugger vocabs words system namespaces ;
+
+:c
+:error
+"listener" vocab
+[ restarts. vocab-main execute ]
+[ die ] if*
+1 exit
index 9968af4330e6c3b752b4e117ee7a3b6d57a45eb3..f0d9e8e131cb43afff4ad18349f235041890f51a 100644 (file)
@@ -5,17 +5,22 @@ sequences namespaces parser kernel kernel.private classes
 classes.private arrays hashtables vectors classes.tuple sbufs
 hashtables.private sequences.private math classes.tuple.private
 growable namespaces.private assocs words command-line vocabs io
-io.encodings.string prettyprint libc splitting math.parser
+io.encodings.string libc splitting math.parser
 compiler.units math.order compiler.tree.builder
 compiler.tree.optimizer compiler.cfg.optimizer ;
 IN: bootstrap.compiler
 
 ! Don't bring this in when deploying, since it will store a
 ! reference to 'eval' in a global variable
-"deploy-vocab" get [
+"deploy-vocab" get "staging" get or [
     "alien.remote-control" require
 ] unless
 
+"prettyprint" vocab [
+    "stack-checker.errors.prettyprint" require
+    "alien.prettyprint" require
+] when
+
 "cpu." cpu name>> append require
 
 enable-compiler
@@ -86,7 +91,7 @@ nl
 "." write flush
 
 {
-    malloc calloc free memcpy
+    malloc calloc free memcpy
 } compile-uncompiled
 
 "." write flush
diff --git a/basis/bootstrap/finish-bootstrap.factor b/basis/bootstrap/finish-bootstrap.factor
new file mode 100644 (file)
index 0000000..133b64a
--- /dev/null
@@ -0,0 +1,16 @@
+USING: init command-line debugger system continuations
+namespaces eval kernel vocabs.loader io ;
+
+[
+    boot
+    do-init-hooks
+    [
+        (command-line) parse-command-line
+        load-vocab-roots
+        run-user-init
+        "e" get [ eval ] when*
+        ignore-cli-args? not script get and
+        [ run-script ] [ "run" get run ] if*
+        output-stream get [ stream-flush ] when*
+    ] [ print-error 1 exit ] recover
+] set-boot-quot
diff --git a/basis/bootstrap/finish-staging.factor b/basis/bootstrap/finish-staging.factor
new file mode 100644 (file)
index 0000000..a60ce04
--- /dev/null
@@ -0,0 +1,10 @@
+USING: init command-line system namespaces kernel vocabs.loader
+io ;
+
+[
+    boot
+    do-init-hooks
+    (command-line) parse-command-line
+    "run" get run
+    output-stream get [ stream-flush ] when*
+] set-boot-quot
index a293efd33eae01d46d8c9c12c4dfe0d7cce6c10a..347969af0d6698cb65230ddaec7a8aa90efea2bf 100644 (file)
@@ -1,5 +1,7 @@
-USE: vocabs.loader
+USING: vocabs vocabs.loader kernel ;
 
 "math.ratios" require
 "math.floats" require
 "math.complex" require
+
+"prettyprint" vocab [ "math.complex.prettyprint" require ] when
index 4ab36ec94e9361a6efbf23a2a2550416735c9738..78355a46702b383edf3536450ae5e6856cb430ad 100644 (file)
@@ -2,10 +2,10 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors init namespaces words io
 kernel.private math memory continuations kernel io.files
-io.backend system parser vocabs sequences prettyprint
+io.backend system parser vocabs sequences
 vocabs.loader combinators splitting source-files strings
 definitions assocs compiler.errors compiler.units
-math.parser generic sets debugger command-line ;
+math.parser generic sets command-line ;
 IN: bootstrap.stage2
 
 SYMBOL: core-bootstrap-time
@@ -86,25 +86,18 @@ SYMBOL: bootstrap-time
     f error set-global
     f error-continuation set-global
 
+    millis swap - bootstrap-time set-global
+    print-report
+
     "deploy-vocab" get [
         "tools.deploy.shaker" run
     ] [
-        [
-            boot
-            do-init-hooks
-            handle-command-line
-        ] set-boot-quot
-
-        millis swap - bootstrap-time set-global
-        print-report
+        "staging" get [
+            "resource:basis/bootstrap/finish-staging.factor" run-file
+        ] [
+            "resource:basis/bootstrap/finish-bootstrap.factor" run-file
+        ] if
 
         "output-image" get save-image-and-exit
     ] if
-] [
-    :c
-    dup print-error flush
-    "listener" vocab
-    [ restarts. vocab-main execute ]
-    [ die ] if*
-    1 exit
-] recover
+] [ drop "resource:basis/bootstrap/bootstrap-error.factor" run-file ] recover
index b2c0d55c0f663a77807e11a1780c73bcd67b4209..e24c808bbc79e91d299a77f97ac17564c61465b5 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.\r
 USING: arrays kernel kernel.private math sequences\r
 sequences.private growable byte-arrays accessors parser\r
-prettyprint.backend ;\r
+prettyprint.custom ;\r
 IN: byte-vectors\r
 \r
 TUPLE: byte-vector\r
index 257fd930c46c08818d5d0830b50c4103c98f5d0c..d919b0e31305b366b1b05cb6691429d9cfc74856 100644 (file)
@@ -4,7 +4,7 @@ USING: kernel io io.binary io.files io.streams.byte-array math
 math.functions math.parser namespaces splitting grouping strings
 sequences byte-arrays locals sequences.private
 io.encodings.binary symbols math.bitwise checksums
-checksums.common ;
+checksums.common checksums.stream ;
 IN: checksums.md5
 
 ! See http://www.faqs.org/rfcs/rfc1321.html
@@ -180,7 +180,7 @@ PRIVATE>
 
 SINGLETON: md5
 
-INSTANCE: md5 checksum
+INSTANCE: md5 stream-checksum
 
 M: md5 checksum-stream ( stream -- byte-array )
     drop [ initialize-md5 stream>md5 get-md5 ] with-input-stream ;
index 821cbe2f3afe282195aacc66dbd075cdb8d7e0c5..4bc7a7964a11c6e0d46f7ad8f29701fe45e1945f 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2008 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors byte-arrays alien.c-types kernel continuations
-destructors sequences io openssl openssl.libcrypto checksums ;
+destructors sequences io openssl openssl.libcrypto checksums
+checksums.stream ;
 IN: checksums.openssl
 
 ERROR: unknown-digest name ;
@@ -12,7 +13,7 @@ TUPLE: openssl-checksum name ;
 
 : openssl-sha1 T{ openssl-checksum f "sha1" } ;
 
-INSTANCE: openssl-checksum checksum
+INSTANCE: openssl-checksum stream-checksum
 
 C: <openssl-checksum> openssl-checksum
 
index 3767af7c5590877907c9882380c8e58352e6edf6..6cdc9270aa7262b8057db66b94007975e359f2f7 100644 (file)
@@ -3,7 +3,8 @@
 USING: arrays combinators kernel io io.encodings.binary io.files
 io.streams.byte-array math.vectors strings sequences namespaces
 make math parser sequences assocs grouping vectors io.binary
-hashtables symbols math.bitwise checksums checksums.common ;
+hashtables symbols math.bitwise checksums checksums.common
+checksums.stream ;
 IN: checksums.sha1
 
 ! Implemented according to RFC 3174.
@@ -113,7 +114,7 @@ SYMBOLS: h0 h1 h2 h3 h4 A B C D E w K ;
 
 SINGLETON: sha1
 
-INSTANCE: sha1 checksum
+INSTANCE: sha1 stream-checksum
 
 M: sha1 checksum-stream ( stream -- sha1 )
     drop [ initialize-sha1 stream>sha1 get-sha1 ] with-input-stream ;
diff --git a/basis/checksums/stream/stream.factor b/basis/checksums/stream/stream.factor
new file mode 100644 (file)
index 0000000..e753467
--- /dev/null
@@ -0,0 +1,12 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.encodings.binary io.streams.byte-array kernel
+checksums ;
+IN: checksums.stream
+
+MIXIN: stream-checksum
+
+M: stream-checksum checksum-bytes
+    [ binary <byte-reader> ] dip checksum-stream ;
+
+INSTANCE: stream-checksum checksum
index 1b58053b64d2af681760f542902957fb147bd51f..7d5a041951a6320fbb2872afb9b2410e20e5c38e 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2003, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: init continuations debugger hashtables io
-io.encodings.utf8 io.files kernel kernel.private namespaces
-parser sequences strings system splitting eval vocabs.loader ;
+USING: init continuations hashtables io io.encodings.utf8
+io.files kernel kernel.private namespaces parser sequences
+strings system splitting vocabs.loader ;
 IN: command-line
 
 SYMBOL: script
@@ -31,8 +31,6 @@ SYMBOL: command-line
         ] [ drop ] if
     ] when ;
 
-<PRIVATE
-
 : var-param ( name value -- ) swap set-global ;
 
 : bool-param ( name -- ) "no-" ?head not var-param ;
@@ -43,8 +41,6 @@ SYMBOL: command-line
 : run-script ( file -- )
     t "quiet" set-global run-file ;
 
-PRIVATE>
-
 : parse-command-line ( args -- )
     [ command-line off script off ] [
         unclip "-" ?head
@@ -76,15 +72,4 @@ SYMBOL: main-vocab-hook
 
 : script-mode ( -- ) ;
 
-: handle-command-line ( -- )
-    [
-        (command-line) parse-command-line
-        load-vocab-roots
-        run-user-init
-        "e" get [ eval ] when*
-        ignore-cli-args? not script get and
-        [ run-script ] [ "run" get run ] if*
-        output-stream get [ stream-flush ] when*
-    ] [ print-error 1 exit ] recover ;
-
 [ default-cli-args ] "command-line" add-init-hook
index c7094c8c360e2d2b8100165a0858ca5ed88f1f34..d8bad5ec410a61f511759732f7cde7ab6a9a48a6 100644 (file)
@@ -1,6 +1,6 @@
 USING: compiler.cfg.instructions compiler.cfg.registers
-compiler.cfg.alias-analysis cpu.architecture tools.test
-kernel ;
+compiler.cfg.alias-analysis compiler.cfg.debugger
+cpu.architecture tools.test kernel ;
 IN: compiler.cfg.alias-analysis.tests
 
 [ ] [
index b9c3af521543a22a93cd3271dd727c6e8f83fc43..ee7d8d2a434688986b367ea668f1f8872cdfdf06 100644 (file)
@@ -1,5 +1,6 @@
 USING: compiler.cfg.dead-code compiler.cfg.instructions
-compiler.cfg.registers cpu.architecture tools.test ;
+compiler.cfg.registers compiler.cfg.debugger
+cpu.architecture tools.test ;
 IN: compiler.cfg.dead-code.tests
 
 [ { } ] [
index 7b1b9100c407df35eaa4eb86489038c70632d94d..ba58e60a4ad0c15f8df8f12f3ecc0cbd6f69d88b 100644 (file)
@@ -2,10 +2,12 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel words sequences quotations namespaces io
 classes.tuple accessors prettyprint prettyprint.config
-compiler.tree.builder compiler.tree.optimizer
+prettyprint.backend prettyprint.custom prettyprint.sections
+parser compiler.tree.builder compiler.tree.optimizer
 compiler.cfg.builder compiler.cfg.linearization
-compiler.cfg.stack-frame compiler.cfg.linear-scan
-compiler.cfg.two-operand compiler.cfg.optimizer ;
+compiler.cfg.registers compiler.cfg.stack-frame
+compiler.cfg.linear-scan compiler.cfg.two-operand
+compiler.cfg.optimizer ;
 IN: compiler.cfg.debugger
 
 GENERIC: test-cfg ( quot -- cfgs )
@@ -40,3 +42,15 @@ SYMBOL: allocate-registers?
         instructions>> [ insn. ] each
         nl
     ] each ;
+
+! Prettyprinting
+M: vreg pprint*
+    <block
+    \ V pprint-word [ reg-class>> pprint* ] [ n>> pprint* ] bi
+    block> ;
+
+: pprint-loc ( loc word -- ) <block pprint-word n>> pprint* block> ;
+
+M: ds-loc pprint* \ D pprint-loc ;
+
+M: rs-loc pprint* \ R pprint-loc ;
index 21572ec6153efcc9d033645781776aa680d6ac98..2b9d3df6f674896fb4e42a3a7759fb1e5eb17f9e 100644 (file)
@@ -1,7 +1,6 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors namespaces kernel arrays
-parser prettyprint.backend prettyprint.sections ;
+USING: accessors namespaces kernel arrays parser ;
 IN: compiler.cfg.registers
 
 ! Virtual registers, used by CFG and machine IRs
@@ -18,20 +17,6 @@ C: <ds-loc> ds-loc
 TUPLE: rs-loc < loc ;
 C: <rs-loc> rs-loc
 
-! Prettyprinting
 : V scan-word scan-word vreg boa parsed ; parsing
-
-M: vreg pprint*
-    <block
-    \ V pprint-word [ reg-class>> pprint* ] [ n>> pprint* ] bi
-    block> ;
-
-: pprint-loc ( loc word -- ) <block pprint-word n>> pprint* block> ;
-
 : D scan-word <ds-loc> parsed ; parsing
-
-M: ds-loc pprint* \ D pprint-loc ;
-
 : R scan-word <rs-loc> parsed ; parsing
-
-M: rs-loc pprint* \ R pprint-loc ;
index 8adeaa21f4ddd4485942102614a0d76542e21b9d..641ccceb5daee5f43514caaec892a28e9e45174b 100644 (file)
@@ -1,7 +1,8 @@
 IN: compiler.cfg.value-numbering.tests
 USING: compiler.cfg.value-numbering compiler.cfg.instructions
-compiler.cfg.registers cpu.architecture tools.test kernel math
-combinators.short-circuit accessors sequences ;
+compiler.cfg.registers compiler.cfg.debugger cpu.architecture
+tools.test kernel math combinators.short-circuit accessors
+sequences ;
 
 : trim-temps ( insns -- insns )
     [
index 7a4b1c488faa4f7ebce1d2387f0e889f5d214537..73748dbc37c33fa4d89f7f488b7e176bdbc6abe4 100644 (file)
@@ -1,5 +1,6 @@
 USING: compiler.cfg.write-barrier compiler.cfg.instructions
-compiler.cfg.registers cpu.architecture arrays tools.test ;
+compiler.cfg.registers compiler.cfg.debugger cpu.architecture
+arrays tools.test ;
 IN: compiler.cfg.write-barrier.tests
 
 [
index a56ae04a7b87de4248285afa0c7e426fe30f5bd8..e0f391deb5f925740c9f410253bb638701f32cd2 100755 (executable)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2007, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays byte-arrays generic assocs hashtables io.binary
-kernel kernel.private math namespaces make sequences words
-quotations strings alien.accessors alien.strings layouts system
-combinators math.bitwise words.private math.order accessors
-growable cpu.architecture compiler.constants ;
+USING: arrays byte-arrays byte-vectors generic assocs hashtables
+io.binary kernel kernel.private math namespaces make sequences
+words quotations strings alien.accessors alien.strings layouts
+system combinators math.bitwise words.private math.order
+accessors growable cpu.architecture compiler.constants ;
 IN: compiler.codegen.fixup
 
 GENERIC: fixup* ( obj -- )
index e5cbd888d94f0ddc93127ce810380103882a2255..0d24daef7103220b2ced01f573a0f42fb2e52333 100644 (file)
@@ -1,15 +1,14 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel namespaces arrays sequences io debugger
-words fry continuations vocabs assocs dlists definitions
-math threads graphs generic combinators deques search-deques
-prettyprint io stack-checker stack-checker.state
-stack-checker.inlining compiler.errors compiler.units
-compiler.tree.builder compiler.tree.optimizer
-compiler.cfg.builder compiler.cfg.optimizer
-compiler.cfg.linearization compiler.cfg.two-operand
-compiler.cfg.linear-scan compiler.cfg.stack-frame
-compiler.codegen ;
+USING: accessors kernel namespaces arrays sequences io
+words fry continuations vocabs assocs dlists definitions math
+threads graphs generic combinators deques search-deques io
+stack-checker stack-checker.state stack-checker.inlining
+compiler.errors compiler.units compiler.tree.builder
+compiler.tree.optimizer compiler.cfg.builder
+compiler.cfg.optimizer compiler.cfg.linearization
+compiler.cfg.two-operand compiler.cfg.linear-scan
+compiler.cfg.stack-frame compiler.codegen ;
 IN: compiler
 
 SYMBOL: compile-queue
@@ -45,7 +44,7 @@ SYMBOL: +failed+
     2bi ;
 
 : start ( word -- )
-    "trace-compilation" get [ dup . flush ] when
+    "trace-compilation" get [ dup name>> print flush ] when
     H{ } clone dependencies set
     H{ } clone generic-dependencies set
     f swap compiler-error ;
index 8d764a28333c81d7092163e8f51e4c7b9fe33132..8a2823010dc41ac54f5986ee9330bda54e211c0c 100644 (file)
@@ -2,8 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel assocs match fry accessors namespaces make effects
 sequences sequences.private quotations generic macros arrays
-prettyprint prettyprint.backend prettyprint.sections math words
-combinators combinators.short-circuit io sorting hints qualified
+prettyprint prettyprint.backend prettyprint.custom
+prettyprint.sections math words combinators
+combinators.short-circuit io sorting hints qualified
 compiler.tree
 compiler.tree.recursive
 compiler.tree.normalization
index 35b09713d3c7da0558e9db448e3f2bd24d87955a..4e0c4e88405d05d9daa852ff9c4973b2693f09c1 100644 (file)
@@ -22,9 +22,6 @@ M: tuple error-help class ;
 
 M: string error. print ;
 
-: :error ( -- )
-    error get error. ;
-
 : :s ( -- )
     error-continuation get data>> stack. ;
 
@@ -63,6 +60,9 @@ M: string error. print ;
     [ global [ "Error in print-error!" print drop ] bind ]
     recover ;
 
+: :error ( -- )
+    error get print-error ;
+
 : print-error-and-restarts ( error -- )
     print-error
     restarts.
index e5202e13064b0bdbc2b397516351cb3b531f4804..3e4066d8b75bfdf5c0332654546f16321188cb76 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2007, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors definitions help help.topics help.syntax
-prettyprint.backend prettyprint words kernel effects ;
+prettyprint.backend prettyprint.custom prettyprint words kernel
+effects ;
 IN: help.definitions
 
 ! Definition protocol implementation
index 0a392733acc12d02cc575a4ab8415e5ad383f4d2..fbebc7f0f6b0661bc35f649f51425c9c7dbf2442 100644 (file)
@@ -150,7 +150,7 @@ M: help-error error.
     ] [
         [
             swap vocab-heading.
-            [ error. nl ] each
+            [ print-error nl ] each
         ] assoc-each
     ] if-empty ;
 
index c9ba8f66dfe0a82ff6c5d5fedd8e2635aa596f12..e07753c64076990032f20991523f05ac79f12cdc 100644 (file)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2005, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: hashtables io colors ;
+USING: hashtables io colors summary make accessors splitting
+kernel ;
 IN: io.styles
 
 SYMBOL: plain
@@ -43,4 +44,11 @@ TUPLE: input string ;
 
 C: <input> input
 
+M: input summary
+    [
+        "Input: " %
+        string>> "\n" split1 swap %
+        "..." "" ? %
+    ] "" make ;
+
 : write-object ( str obj -- ) presented associate format ;
index b78b95bc245bd05142ce5bd540770c21f84e36e4..80bafb0b55c0f113cde89b291f51b21c4dd41e9a 100644 (file)
@@ -2,9 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel namespaces make sequences sequences.private assocs
 math vectors strings classes.tuple generalizations parser words
-quotations debugger macros arrays macros splitting combinators
-prettyprint.backend definitions prettyprint hashtables
-prettyprint.sections sets sequences.private effects
+quotations macros arrays macros splitting combinators
+prettyprint.backend prettyprint.custom definitions prettyprint
+hashtables prettyprint.sections sets sequences.private effects
 effects.parser generic generic.parser compiler.units accessors
 locals.backend memoize macros.expander lexer classes summary fry
 fry.private ;
index c228684e321f1ae61ef091af4bf16793aee5abdd..90713cd40fe7aa07102c40a0e39424561a553483 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2006, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel kernel.private math math.private
-math.libm math.functions prettyprint.backend arrays
-math.functions.private sequences parser ;
+math.libm math.functions arrays math.functions.private sequences
+parser ;
 IN: math.complex.private
 
 M: real real-part ;
@@ -47,7 +47,3 @@ M: complex sqrt >polar [ fsqrt ] [ 2.0 / ] bi* polar> ;
 IN: syntax
 
 : C{ \ } [ first2 rect> ] parse-literal ; parsing
-
-M: complex pprint-delims drop \ C{ \ } ;
-M: complex >pprint-sequence >rect 2array ;
-M: complex pprint* pprint-object ;
diff --git a/basis/math/complex/prettyprint/prettyprint.factor b/basis/math/complex/prettyprint/prettyprint.factor
new file mode 100644 (file)
index 0000000..09eeb80
--- /dev/null
@@ -0,0 +1,8 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: math math.functions arrays prettyprint.custom kernel ;
+IN: math.complex.prettyprint
+
+M: complex pprint* pprint-object ;
+M: complex pprint-delims drop \ C{ \ } ;
+M: complex >pprint-sequence >rect 2array ;
index c753d0fb78589c9662188f479a0b3b29d00d5982..82643bef154a72488ca922931ef95acb344eeb05 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: math kernel sequences sequences.private byte-arrays
-alien.c-types prettyprint.backend parser accessors ;
+alien.c-types prettyprint.custom parser accessors ;
 IN: nibble-arrays
 
 TUPLE: nibble-array
index e50fd52c1051eb52391929295546f852deb2475b..8c80782a2e5da3d8dfcda6d3e91ee63aa798848f 100644 (file)
@@ -1,7 +1,7 @@
 ! Based on Clojure's PersistentHashMap by Rich Hickey.
 
 USING: kernel math accessors assocs fry combinators parser
-prettyprint.backend make
+prettyprint.custom make
 persistent.assocs
 persistent.hashtables.nodes
 persistent.hashtables.nodes.empty
index 92b3f82a54c00d08ddc49e8624d2b54db5e284b6..cd8e7c49e0b29c090c3e9b9f8fc6868e907522a1 100644 (file)
@@ -1,7 +1,7 @@
 ! Based on Clojure's PersistentVector by Rich Hickey.
 
 USING: math accessors kernel sequences.private sequences arrays
-combinators combinators.short-circuit parser prettyprint.backend
+combinators combinators.short-circuit parser prettyprint.custom
 persistent.sequences ;
 IN: persistent.vectors
 
index 64e1fd45ff1b3c51532aa01d0707185d005deec5..165621887fd77a5c496bf9b795dfa31edcd94060 100644 (file)
@@ -1,14 +1,10 @@
 USING: help.markup help.syntax io kernel
-prettyprint.config prettyprint.sections words strings ;
+prettyprint.config prettyprint.sections prettyprint.custom
+words strings ;
 IN: prettyprint.backend
 
 ABOUT: "prettyprint-extension"
 
-HELP: pprint*
-{ $values { "obj" "an object" } }
-{ $contract "Adds sections to the current block corresponding to the prettyprinted representation of the object." }
-$prettyprinting-note ;
-
 HELP: pprint-word
 { $values { "word" "a word" } }
 { $description "Adds a text section for the word. Unlike the " { $link word } " method of " { $link pprint* } ", this does not add a " { $link POSTPONE: POSTPONE: } " prefix to parsing words." }
index 76c3918f639f987560afa808ee2892b442c5ea96..92d039a15df894293dc23138870352ac9302820a 100644 (file)
@@ -1,15 +1,13 @@
 ! Copyright (C) 2003, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays byte-arrays byte-vectors generic
-hashtables io assocs kernel math namespaces make sequences
-strings sbufs io.styles vectors words prettyprint.config
+USING: accessors arrays byte-arrays generic hashtables io assocs
+kernel math namespaces make sequences strings sbufs io.styles
+vectors words prettyprint.config prettyprint.custom
 prettyprint.sections quotations io io.files math.parser effects
 classes.tuple math.order classes.tuple.private classes
 combinators colors ;
 IN: prettyprint.backend
 
-GENERIC: pprint* ( obj -- )
-
 M: effect pprint* effect>string "(" ")" surround text ;
 
 : ?effect-height ( word -- n )
@@ -161,26 +159,19 @@ M: tuple pprint*
     [ [ pprint* ] each ] dip
     [ "~" swap number>string " more~" 3append text ] when* ;
 
-GENERIC: pprint-delims ( obj -- start end )
-
 M: quotation pprint-delims drop \ [ \ ] ;
 M: curry pprint-delims drop \ [ \ ] ;
 M: compose pprint-delims drop \ [ \ ] ;
 M: array pprint-delims drop \ { \ } ;
 M: byte-array pprint-delims drop \ B{ \ } ;
-M: byte-vector pprint-delims drop \ BV{ \ } ;
 M: vector pprint-delims drop \ V{ \ } ;
 M: hashtable pprint-delims drop \ H{ \ } ;
 M: tuple pprint-delims drop \ T{ \ } ;
 M: wrapper pprint-delims drop \ W{ \ } ;
 M: callstack pprint-delims drop \ CS{ \ } ;
 
-GENERIC: >pprint-sequence ( obj -- seq )
-
 M: object >pprint-sequence ;
-
 M: vector >pprint-sequence ;
-M: byte-vector >pprint-sequence ;
 M: curry >pprint-sequence ;
 M: compose >pprint-sequence ;
 M: hashtable >pprint-sequence >alist ;
@@ -191,16 +182,13 @@ M: tuple >pprint-sequence
     [ class ] [ tuple-slots ] bi
     [ 1array ] [ [ f 2array ] dip append ] if-empty ;
 
-GENERIC: pprint-narrow? ( obj -- ? )
-
 M: object pprint-narrow? drop f ;
-
 M: array pprint-narrow? drop t ;
 M: vector pprint-narrow? drop t ;
 M: hashtable pprint-narrow? drop t ;
 M: tuple pprint-narrow? drop t ;
 
-: pprint-object ( obj -- )
+M: object pprint-object ( obj -- )
     [
         <flow
         dup pprint-delims [
@@ -213,7 +201,6 @@ M: tuple pprint-narrow? drop t ;
 
 M: object pprint* pprint-object ;
 M: vector pprint* pprint-object ;
-M: byte-vector pprint* pprint-object ;
 M: hashtable pprint* pprint-object ;
 M: curry pprint* pprint-object ;
 M: compose pprint* pprint-object ;
diff --git a/basis/prettyprint/custom/custom-docs.factor b/basis/prettyprint/custom/custom-docs.factor
new file mode 100644 (file)
index 0000000..60557e6
--- /dev/null
@@ -0,0 +1,9 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel help.markup help.syntax ;
+IN: prettyprint.custom
+
+HELP: pprint*
+{ $values { "obj" object } }
+{ $contract "Adds sections to the current block corresponding to the prettyprinted representation of the object." }
+$prettyprinting-note ;
diff --git a/basis/prettyprint/custom/custom.factor b/basis/prettyprint/custom/custom.factor
new file mode 100644 (file)
index 0000000..9fd940c
--- /dev/null
@@ -0,0 +1,9 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+IN: prettyprint.custom
+
+GENERIC: pprint* ( obj -- )
+GENERIC: pprint-object ( obj -- )
+GENERIC: pprint-delims ( obj -- start end )
+GENERIC: >pprint-sequence ( obj -- seq )
+GENERIC: pprint-narrow? ( obj -- ? )
index 3c004e5b305c6837955f0025903d0ef1cb845e79..46d4e6e5ff5dbcd31ac4b78864effb8b585a41c2 100644 (file)
@@ -1,4 +1,4 @@
-USING: prettyprint.backend prettyprint.config
+USING: prettyprint.backend prettyprint.config prettyprint.custom
 prettyprint.sections prettyprint.private help.markup help.syntax
 io kernel words definitions quotations strings generic classes ;
 IN: prettyprint
index 7c4de1e973764081efc51b1f15cb6d23e88085f8..9d5af9e6a5afaeb47499a88cd248460d884d16d2 100644 (file)
@@ -2,12 +2,13 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays generic generic.standard assocs io kernel math
 namespaces make sequences strings io.styles io.streams.string
-vectors words prettyprint.backend prettyprint.sections
-prettyprint.config sorting splitting grouping math.parser vocabs
-definitions effects classes.builtin classes.tuple io.files
-classes continuations hashtables classes.mixin classes.union
-classes.intersection classes.predicate classes.singleton
-combinators quotations sets accessors colors parser ;
+vectors words prettyprint.backend prettyprint.custom
+prettyprint.sections prettyprint.config sorting splitting
+grouping math.parser vocabs definitions effects classes.builtin
+classes.tuple io.files classes continuations hashtables
+classes.mixin classes.union classes.intersection
+classes.predicate classes.singleton combinators quotations sets
+accessors colors parser summary ;
 IN: prettyprint
 
 : make-pprint ( obj quot -- block in use )
@@ -231,6 +232,8 @@ M: pathname synopsis* pprint* ;
         [ synopsis* ] with-in
     ] with-string-writer ;
 
+M: word summary synopsis ;
+
 : synopsis-alist ( definitions -- alist )
     [ dup synopsis swap ] { } map>assoc ;
 
index 25d04ed929efaf7d62c1606c89dadc4f1bd6729e..2cd64e90bf99f1ded6984031203f4766618059eb 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2007, 2008 Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel sequences assocs hashtables parser lexer
-vocabs words namespaces vocabs.loader debugger sets fry ;
+vocabs words namespaces vocabs.loader sets fry ;
 IN: qualified
 
 : define-qualified ( vocab-name prefix-name -- )
index b41e4d271e8f22d4074356240da8551231b0a0eb..c615719cc4da86e7cb3792965a63702c990274a4 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators kernel math sequences strings
-sets assocs prettyprint.backend make lexer namespaces parser
-arrays fry regexp.backend regexp.utils regexp.parser regexp.nfa
-regexp.dfa regexp.traversal regexp.transition-tables splitting
-sorting ;
+USING: accessors combinators kernel math sequences strings sets
+assocs prettyprint.backend prettyprint.custom make lexer
+namespaces parser arrays fry regexp.backend regexp.utils
+regexp.parser regexp.nfa regexp.dfa regexp.traversal
+regexp.transition-tables splitting sorting ;
 IN: regexp
 
 : default-regexp ( string -- regexp )
index 52977dc22ad8d767fb33540c99903661eb3d8305..28946494282ec6ef777a91aa0931f511033ab39c 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: functors sequences sequences.private prettyprint.backend
+USING: functors sequences sequences.private prettyprint.custom
 kernel words classes math parser alien.c-types byte-arrays
 accessors summary ;
 IN: specialized-arrays.functor
index 0628f8b48465c5364afdeee85033b5572a294e4b..8ba5354dc40c79f17783dc0493d630029de12f58 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: functors sequences sequences.private growable
-prettyprint.backend kernel words classes math parser ;
+prettyprint.custom kernel words classes math parser ;
 IN: specialized-vectors.functor
 
 FUNCTOR: define-vector ( T -- )
index 7f8c920b199878fd95a06fbf200aa4065b9ea2b3..147749864d23d2daf5ef41923fb8ec8f72fb34b6 100644 (file)
@@ -1,12 +1,12 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: fry arrays generic io io.streams.string kernel math
-namespaces parser prettyprint sequences strings vectors words
-quotations effects classes continuations debugger assocs
-combinators compiler.errors accessors math.order definitions
-sets generic.standard.engines.tuple hints stack-checker.state
-stack-checker.visitor stack-checker.errors
-stack-checker.values stack-checker.recursive-state ;
+namespaces parser sequences strings vectors words quotations
+effects classes continuations assocs combinators
+compiler.errors accessors math.order definitions sets
+generic.standard.engines.tuple hints stack-checker.state
+stack-checker.visitor stack-checker.errors stack-checker.values
+stack-checker.recursive-state ;
 IN: stack-checker.backend
 
 : push-d ( obj -- ) meta-d push ;
index 5b6b3c089379446056f197d84137f6776f22d492..58944e7bc42bbcdd744800527c50440780f71466 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (C) 2006, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel generic sequences prettyprint io words arrays
-summary effects debugger assocs accessors namespaces
-compiler.errors stack-checker.values
+USING: kernel generic sequences io words arrays summary effects
+assocs accessors namespaces compiler.errors stack-checker.values
 stack-checker.recursive-state ;
 IN: stack-checker.errors
 
@@ -10,8 +9,6 @@ TUPLE: inference-error error type word ;
 
 M: inference-error compiler-error-type type>> ;
 
-M: inference-error error-help error>> error-help ;
-
 : (inference-error) ( ... class type -- * )
     [ boa ] dip
     recursive-state get word>>
@@ -23,14 +20,8 @@ M: inference-error error-help error>> error-help ;
 : inference-warning ( ... class -- * )
     +warning+ (inference-error) ; inline
 
-M: inference-error error.
-    [ word>> [ "In word: " write . ] when* ] [ error>> error. ] bi ;
-
 TUPLE: literal-expected ;
 
-M: literal-expected summary
-    drop "Literal value expected" ;
-
 M: object (literal) \ literal-expected inference-warning ;
 
 TUPLE: unbalanced-branches-error branches quots ;
@@ -38,79 +29,25 @@ TUPLE: unbalanced-branches-error branches quots ;
 : unbalanced-branches-error ( branches quots -- * )
     \ unbalanced-branches-error inference-error ;
 
-M: unbalanced-branches-error error.
-    "Unbalanced branches:" print
-    [ quots>> ] [ branches>> [ length <effect> ] { } assoc>map ] bi zip
-    [ [ first pprint-short bl ] [ second effect>string print ] bi ] each ;
-
 TUPLE: too-many->r ;
 
-M: too-many->r summary
-    drop
-    "Quotation pushes elements on retain stack without popping them" ;
-
 TUPLE: too-many-r> ;
 
-M: too-many-r> summary
-    drop
-    "Quotation pops retain stack elements which it did not push" ;
-
 TUPLE: missing-effect word ;
 
-M: missing-effect error.
-    "The word " write
-    word>> pprint
-    " must declare a stack effect" print ;
-
 TUPLE: effect-error word inferred declared ;
 
 : effect-error ( word inferred declared -- * )
     \ effect-error inference-error ;
 
-M: effect-error error.
-    "Stack effects of the word " write
-    [ word>> pprint " do not match." print ]
-    [ "Inferred: " write inferred>> . ]
-    [ "Declared: " write declared>> . ] tri ;
-
 TUPLE: recursive-quotation-error quot ;
 
-M: recursive-quotation-error error.
-    "The quotation " write
-    quot>> pprint
-    " calls itself." print
-    "Stack effect inference is undecidable when quotation-level recursion is permitted." print ;
-
 TUPLE: undeclared-recursion-error word ;
 
-M: undeclared-recursion-error error.
-    "The inline recursive word " write
-    word>> pprint
-    " must be declared recursive" print ;
-
 TUPLE: diverging-recursion-error word ;
 
-M: diverging-recursion-error error.
-    "The recursive word " write
-    word>> pprint
-    " digs arbitrarily deep into the stack" print ;
-
 TUPLE: unbalanced-recursion-error word height ;
 
-M: unbalanced-recursion-error error.
-    "The recursive word " write
-    word>> pprint
-    " leaves with the stack having the wrong height" print ;
-
 TUPLE: inconsistent-recursive-call-error word ;
 
-M: inconsistent-recursive-call-error error.
-    "The recursive word " write
-    word>> pprint
-    " calls itself with a different set of quotation parameters than were input" print ;
-
 TUPLE: unknown-primitive-error ;
-
-M: unknown-primitive-error error.
-    drop
-    "Cannot determine stack effect statically" print ;
diff --git a/basis/stack-checker/errors/prettyprint/prettyprint.factor b/basis/stack-checker/errors/prettyprint/prettyprint.factor
new file mode 100644 (file)
index 0000000..21c6d64
--- /dev/null
@@ -0,0 +1,67 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors kernel prettyprint io debugger
+sequences assocs stack-checker.errors summary effects ;
+IN: stack-checker.errors.prettyprint
+
+M: inference-error error-help error>> error-help ;
+
+M: inference-error error.
+    [ word>> [ "In word: " write . ] when* ] [ error>> error. ] bi ;
+
+M: literal-expected summary
+    drop "Literal value expected" ;
+
+M: unbalanced-branches-error error.
+    "Unbalanced branches:" print
+    [ quots>> ] [ branches>> [ length <effect> ] { } assoc>map ] bi zip
+    [ [ first pprint-short bl ] [ second effect>string print ] bi ] each ;
+
+M: too-many->r summary
+    drop
+    "Quotation pushes elements on retain stack without popping them" ;
+
+M: too-many-r> summary
+    drop
+    "Quotation pops retain stack elements which it did not push" ;
+
+M: missing-effect error.
+    "The word " write
+    word>> pprint
+    " must declare a stack effect" print ;
+
+M: effect-error error.
+    "Stack effects of the word " write
+    [ word>> pprint " do not match." print ]
+    [ "Inferred: " write inferred>> . ]
+    [ "Declared: " write declared>> . ] tri ;
+
+M: recursive-quotation-error error.
+    "The quotation " write
+    quot>> pprint
+    " calls itself." print
+    "Stack effect inference is undecidable when quotation-level recursion is permitted." print ;
+
+M: undeclared-recursion-error error.
+    "The inline recursive word " write
+    word>> pprint
+    " must be declared recursive" print ;
+
+M: diverging-recursion-error error.
+    "The recursive word " write
+    word>> pprint
+    " digs arbitrarily deep into the stack" print ;
+
+M: unbalanced-recursion-error error.
+    "The recursive word " write
+    word>> pprint
+    " leaves with the stack having the wrong height" print ;
+
+M: inconsistent-recursive-call-error error.
+    "The recursive word " write
+    word>> pprint
+    " calls itself with a different set of quotation parameters than were input" print ;
+
+M: unknown-primitive-error error.
+    drop
+    "Cannot determine stack effect statically" print ;
index 28634f2d44e8fd0c9986d0dac2a605930ae61ba7..0442d4c2276a54eedac3d6f828e10301fff83dfe 100644 (file)
@@ -5,7 +5,7 @@ classes sequences.private continuations.private effects generic
 hashtables hashtables.private io io.backend io.files
 io.files.private io.streams.c kernel kernel.private math
 math.private memory namespaces namespaces.private parser
-prettyprint quotations quotations.private sbufs sbufs.private
+quotations quotations.private sbufs sbufs.private
 sequences sequences.private slots.private strings
 strings.private system threads.private classes.tuple
 classes.tuple.private vectors vectors.private words definitions
index ea2c19fd6df6198746803128a5a0e9b3c3d434c2..44e5374dc52d7a6cd53f2ebddc25aaa4ca1eb899 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors classes sequences splitting kernel namespaces
-make words math math.parser io.styles prettyprint assocs ;
+USING: accessors classes sequences kernel namespaces
+make words math math.parser assocs ;
 IN: summary
 
 GENERIC: summary ( object -- string )
@@ -11,15 +11,6 @@ GENERIC: summary ( object -- string )
 
 M: object summary object-summary ;
 
-M: input summary
-    [
-        "Input: " %
-        string>> "\n" split1 swap %
-        "..." "" ? %
-    ] "" make ;
-
-M: word summary synopsis ;
-
 M: sequence summary
     [
         dup class name>> %
index 18713c7b0c12c9a8ba685f57a8f73141fff91f2f..f33e4840ebb04fdd7c42f68d3d74e2998cdc6a81 100644 (file)
@@ -5,8 +5,8 @@ assocs kernel vocabs words sequences memory io system arrays
 continuations math definitions mirrors splitting parser classes
 summary layouts vocabs.loader prettyprint.config prettyprint
 debugger io.streams.c io.files io.backend quotations io.launcher
-words.private tools.deploy.config bootstrap.image
-io.encodings.utf8 destructors accessors ;
+words.private tools.deploy.config tools.deploy.config.editor
+bootstrap.image io.encodings.utf8 destructors accessors ;
 IN: tools.deploy.backend
 
 : copy-vm ( executable bundle-name extension -- vm )
@@ -88,6 +88,10 @@ DEFER: ?make-staging-image
     dup staging-image-name exists?
     [ drop ] [ make-staging-image ] if ;
 
+: make-deploy-config ( vocab -- file )
+    [ deploy-config unparse-use ] [ "deploy-config-" prepend ] bi
+    [ utf8 set-file-contents ] keep ;
+
 : deploy-command-line ( image vocab config -- flags )
     [
         bootstrap-profile ?make-staging-image
@@ -99,7 +103,8 @@ DEFER: ?make-staging-image
 
             "-run=tools.deploy.shaker" ,
 
-            "-deploy-vocab=" prepend ,
+            [ "-deploy-vocab=" prepend , ]
+            [ make-deploy-config "-deploy-config=" prepend , ] bi
 
             "-output-image=" prepend ,
 
index e8dcd2b90efea45d68af2f582c77df2dead7c1af..c8249e4e41c89522eedd5473fc38bc8b4e5bd805 100644 (file)
@@ -2,16 +2,6 @@ USING: help.markup help.syntax words alien.c-types assocs
 kernel math ;
 IN: tools.deploy.config
 
-ARTICLE: "deploy-config" "Deployment configuration"
-"The deployment configuration is a key/value mapping stored in the " { $snippet "deploy.factor" } " file in the vocabulary's directory. If this file does not exist, the default deployment configuration is used:"
-{ $subsection default-config }
-"The deployment configuration can be read and written with a pair of words:"
-{ $subsection deploy-config }
-{ $subsection set-deploy-config }
-"A utility word is provided to load the configuration, change a flag, and store it back to disk:"
-{ $subsection set-deploy-flag }
-"The " { $link "ui.tools.deploy" } " provides a graphical way of editing the configuration." ;
-
 ARTICLE: "deploy-flags" "Deployment flags"
 "There are two sets of deployment flags. The first set controls the major subsystems which are to be included in the deployment image:"
 { $subsection deploy-math?     }
@@ -25,12 +15,7 @@ ARTICLE: "deploy-flags" "Deployment flags"
 { $subsection deploy-word-props? }
 { $subsection deploy-c-types?    } ;
 
-ARTICLE: "prepare-deploy" "Preparing to deploy an application"
-"In order to deploy an application as a stand-alone image, the application's vocabulary must first be given a " { $link POSTPONE: MAIN: } " hook. Then, a " { $emphasis "deployment configuration" } " must be created."
-{ $subsection "deploy-config" }
-{ $subsection "deploy-flags" } ;
-
-ABOUT: "prepare-deploy"
+ABOUT: "deploy-flags"
 
 HELP: deploy-name
 { $description "Deploy setting. The name of the executable."
@@ -114,15 +99,3 @@ HELP: deploy-reflection
 HELP: default-config
 { $values { "vocab" "a vocabulary specifier" } { "assoc" assoc } }
 { $description "Outputs the default deployment configuration for a vocabulary." } ;
-
-HELP: deploy-config
-{ $values { "vocab" "a vocabulary specifier" } { "assoc" assoc } }
-{ $description "Loads a vocabulary's deployment configuration from the " { $snippet "deploy.factor" } " file in the vocabulary's directory. If the file does not exist, the " { $link default-config } " is output." } ;
-
-HELP: set-deploy-config
-{ $values { "assoc" assoc } { "vocab" "a vocabulary specifier" } }
-{ $description "Stores a vocabulary's deployment configuration to the " { $snippet "deploy.factor" } " file in the vocabulary's directory." } ;
-
-HELP: set-deploy-flag
-{ $values { "value" object } { "key" object } { "vocab" "a vocabulary specifier" } }
-{ $description "Modifies an entry in a vocabulary's deployment configuration on disk." } ;
index 84bfab682be2dc4457fa4db93123d45442b1a24b..1d9761e885c9582dde124d0545fa0eacb121a09f 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (C) 2007, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: vocabs.loader io.files io kernel sequences assocs
-splitting parser prettyprint namespaces math vocabs
-hashtables tools.vocabs ;
+USING: io.files io kernel sequences assocs splitting parser
+namespaces math vocabs hashtables ;
 IN: tools.deploy.config
 
 SYMBOL: deploy-name
@@ -66,18 +65,3 @@ SYMBOL: deploy-image
         ! default value for deploy.macosx
         { "stop-after-last-window?" t }
     } assoc-union ;
-
-: deploy-config-path ( vocab -- string )
-    vocab-dir "deploy.factor" append-path ;
-
-: deploy-config ( vocab -- assoc )
-    dup default-config swap
-    dup deploy-config-path vocab-file-contents
-    parse-fresh [ first assoc-union ] unless-empty ;
-
-: set-deploy-config ( assoc vocab -- )
-    [ unparse-use string-lines ] dip
-    dup deploy-config-path set-vocab-file-contents ;
-
-: set-deploy-flag ( value key vocab -- )
-    [ deploy-config [ set-at ] keep ] keep set-deploy-config ;
diff --git a/basis/tools/deploy/config/editor/editor-docs.factor b/basis/tools/deploy/config/editor/editor-docs.factor
new file mode 100644 (file)
index 0000000..b677d37
--- /dev/null
@@ -0,0 +1,27 @@
+USING: assocs help.markup help.syntax kernel
+tools.deploy.config ;
+IN: tools.deploy.config.editor
+
+ARTICLE: "deploy-config" "Deployment configuration"
+"The deployment configuration is a key/value mapping stored in the " { $snippet "deploy.factor" } " file in the vocabulary's directory. If this file does not exist, the default deployment configuration is used:"
+{ $subsection default-config }
+"The deployment configuration can be read and written with a pair of words:"
+{ $subsection deploy-config }
+{ $subsection set-deploy-config }
+"A utility word is provided to load the configuration, change a flag, and store it back to disk:"
+{ $subsection set-deploy-flag }
+"The " { $link "ui.tools.deploy" } " provides a graphical way of editing the configuration." ;
+
+HELP: deploy-config
+{ $values { "vocab" "a vocabulary specifier" } { "assoc" assoc } }
+{ $description "Loads a vocabulary's deployment configuration from the " { $snippet "deploy.factor" } " file in the vocabulary's directory. If the file does not exist, the " { $link default-config } " is output." } ;
+
+HELP: set-deploy-config
+{ $values { "assoc" assoc } { "vocab" "a vocabulary specifier" } }
+{ $description "Stores a vocabulary's deployment configuration to the " { $snippet "deploy.factor" } " file in the vocabulary's directory." } ;
+
+HELP: set-deploy-flag
+{ $values { "value" object } { "key" object } { "vocab" "a vocabulary specifier" } }
+{ $description "Modifies an entry in a vocabulary's deployment configuration on disk." } ;
+
+ABOUT: "deploy-config"
diff --git a/basis/tools/deploy/config/editor/editor.factor b/basis/tools/deploy/config/editor/editor.factor
new file mode 100644 (file)
index 0000000..2b5788a
--- /dev/null
@@ -0,0 +1,20 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: assocs io.files kernel parser prettyprint sequences
+splitting tools.deploy.config tools.vocabs vocabs.loader ;
+IN: tools.deploy.config.editor
+
+: deploy-config-path ( vocab -- string )
+    vocab-dir "deploy.factor" append-path ;
+
+: deploy-config ( vocab -- assoc )
+    dup default-config swap
+    dup deploy-config-path vocab-file-contents
+    parse-fresh [ first assoc-union ] unless-empty ;
+
+: set-deploy-config ( assoc vocab -- )
+    [ unparse-use string-lines ] dip
+    dup deploy-config-path set-vocab-file-contents ;
+
+: set-deploy-flag ( value key vocab -- )
+    [ deploy-config [ set-at ] keep ] keep set-deploy-config ;
index eccb3982c7c3342399b7797c6a179b89a67294da..00e747cf0076aaf298890f16ad09d26228d8519f 100644 (file)
@@ -2,6 +2,11 @@ USING: help.markup help.syntax words alien.c-types assocs
 kernel ;
 IN: tools.deploy
 
+ARTICLE: "prepare-deploy" "Preparing to deploy an application"
+"In order to deploy an application as a stand-alone image, the application's vocabulary must first be given a " { $link POSTPONE: MAIN: } " hook. Then, a " { $emphasis "deployment configuration" } " must be created."
+{ $subsection "deploy-config" }
+{ $subsection "deploy-flags" } ;
+
 ARTICLE: "tools.deploy" "Application deployment"
 "The stand-alone application deployment tool compiles a vocabulary down to a native executable which runs the vocabulary's " { $link POSTPONE: MAIN: } " hook. Deployed executables do not depend on Factor being installed, and do not expose any source code, and thus are suitable for delivering commercial end-user applications."
 $nl
index 15fd2a37d792588c06adda429643746d291f7481..01cc80e90d020eb0a70c4cd8e672e3be4a02702b 100755 (executable)
@@ -1,11 +1,11 @@
 ! Copyright (C) 2007, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors qualified io.backend io.streams.c init fry
-namespaces make assocs kernel parser lexer strings.parser
-tools.deploy.config vocabs sequences words words.private memory
-kernel.private continuations io prettyprint vocabs.loader
-debugger system strings sets vectors quotations byte-arrays
-sorting compiler.units definitions generic generic.standard ;
+namespaces make assocs kernel parser lexer strings.parser vocabs
+sequences words words.private memory kernel.private
+continuations io vocabs.loader system strings sets
+vectors quotations byte-arrays sorting compiler.units
+definitions generic generic.standard tools.deploy.config ;
 QUALIFIED: bootstrap.stage2
 QUALIFIED: classes
 QUALIFIED: command-line
@@ -14,7 +14,6 @@ QUALIFIED: continuations
 QUALIFIED: definitions
 QUALIFIED: init
 QUALIFIED: layouts
-QUALIFIED: prettyprint.config
 QUALIFIED: source-files
 QUALIFIED: vocabs
 IN: tools.deploy.shaker
@@ -41,7 +40,7 @@ IN: tools.deploy.shaker
     ] when ;
 
 : strip-debugger ( -- )
-    strip-debugger? [
+    strip-debugger? "debugger" vocab and [
         "Stripping debugger" show
         "resource:basis/tools/deploy/shaker/strip-debugger.factor"
         run-file
@@ -81,14 +80,11 @@ IN: tools.deploy.shaker
                 >alist f like
             ] change-props drop
         ] each
-    ] [
-        "Remaining word properties:\n" show
-        [ props>> keys ] gather unparse show
     ] [
         H{ } clone '[
             [ [ _ [ ] cache ] map ] change-props drop
         ] each
-    ] tri ;
+    ] bi ;
 
 : stripped-word-props ( -- seq )
     [
@@ -275,12 +271,7 @@ IN: tools.deploy.shaker
         ] when
 
         strip-prettyprint? [
-            {
-                prettyprint.config:margin
-                prettyprint.config:string-limit?
-                prettyprint.config:boa-tuples?
-                prettyprint.config:tab-size
-            } %
+            { } { "prettyprint.config" } strip-vocab-globals %
         ] when
 
         strip-debugger? [
@@ -308,7 +299,6 @@ IN: tools.deploy.shaker
         '[ drop _ member? not ] assoc-filter
         [ drop string? not ] assoc-filter ! strip CLI args
         sift-assoc
-        dup keys unparse show
         21 setenv
     ] [ drop ] if ;
 
@@ -362,7 +352,7 @@ SYMBOL: deploy-vocab
         init-hooks get values concat %
         ,
         strip-io? [ \ flush , ] unless
-    ] [ ] make "Boot quotation: " show dup unparse show
+    ] [ ] make
     set-boot-quot ;
 
 : init-stripper ( -- )
@@ -405,16 +395,14 @@ SYMBOL: deploy-vocab
             deploy-vocab get require
             strip
             finish-deploy
-        ] [
-            print-error flush 1 exit
-        ] recover
+        ] [ die 1 exit ] recover
     ] bind ;
 
 : do-deploy ( -- )
     "output-image" get
     "deploy-vocab" get
     "Deploying " write dup write "..." print
-    dup deploy-config dup .
+    "deploy-config" get parse-file first
     (deploy) ;
 
 MAIN: do-deploy
index 782f244c6874d9560755f5b0787461a45dc6738a..96f5a043788c83f6113bfeddbb347c513aabf709 100644 (file)
@@ -1,6 +1,6 @@
 IN: tools.disassembler.tests\r
-USING: math classes.tuple prettyprint.backend tools.disassembler\r
-tools.test strings ;\r
+USING: math classes.tuple prettyprint.custom \r
+tools.disassembler tools.test strings ;\r
 \r
 [ ] [ \ + disassemble ] unit-test\r
 [ ] [ { string pprint* } disassemble ] unit-test\r
index c0fb1695c3358603e6abbd3fa1bcdb5a32358a81..5f6d04a54f55cff58e6b8fa96eed11c0e4c39207 100644 (file)
@@ -2,9 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel ascii combinators combinators.short-circuit
 sequences splitting fry namespaces make assocs arrays strings
-io.sockets io.encodings.string
-io.encodings.utf8 math math.parser accessors parser
-strings.parser lexer prettyprint.backend hashtables present
+io.sockets io.encodings.string io.encodings.utf8 math
+math.parser accessors parser strings.parser lexer
+prettyprint.backend prettyprint.custom hashtables present
 peg.ebnf urls.encoding ;
 IN: urls
 
index e0f7e555541e28bfd87e40afedc64a095c44978d..ea40594964760773e50c6efe0ccb165abd5d80f8 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays accessors sequences sequences.private
 persistent.sequences assocs persistent.assocs kernel math
-vectors parser prettyprint.backend ;
+vectors parser prettyprint.custom ;
 IN: vlists
 
 TUPLE: vlist
index f90ba23999994607ae6bcac9ff3f38af23ed512f..42e1de19ee044b196ca5dfa4a31ae47cecc88722 100644 (file)
@@ -68,7 +68,6 @@ bootstrapping? on
     "alien.accessors"
     "arrays"
     "byte-arrays"
-    "byte-vectors"
     "classes.private"
     "classes.tuple"
     "classes.tuple.private"
index 26a27ecefb76fc465a28334cb7478f2f87effaad..874a9dd0d215dd418ebc04263b125ed981d29c64 100644 (file)
@@ -31,7 +31,7 @@ load-help? off
     "math.integers" require
     "math.floats" require
     "memory" require
-
+    
     "io.streams.c" require
     "vocabs.loader" require
     
index e7dd333ed8e90e03592d5c520d5237904b0fb963..badc1f5218165ab1686ad9b8f7883e07f06c043f 100644 (file)
@@ -16,7 +16,6 @@ IN: bootstrap.syntax
     "<PRIVATE"
     "BIN:"
     "B{"
-    "BV{"
     "C:"
     "CHAR:"
     "DEFER:"
index 4b0d9e5072658b35e4f976801a4e313b866bb6da..699d93b8b4f994a9fbaa186b3ab03e74ae4f9b07 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (c) 2008 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: sequences math.parser io io.streams.byte-array
-io.encodings.binary io.files kernel ;
+USING: sequences math.parser io io.encodings.binary io.files
+kernel ;
 IN: checksums
 
 MIXIN: checksum
@@ -12,9 +12,6 @@ GENERIC: checksum-stream ( stream checksum -- value )
 
 GENERIC: checksum-lines ( lines checksum -- value )
 
-M: checksum checksum-bytes
-    [ binary <byte-reader> ] dip checksum-stream ;
-
 M: checksum checksum-stream
     [ contents ] dip checksum-bytes ;
 
index 810bdbe10fc23ae0c4eb26e0b5880182403e188f..2730e4683bc06b8215270c9ac51bd6845854311a 100644 (file)
@@ -4,6 +4,7 @@ IN: classes.algebra
 \r
 ARTICLE: "class-operations" "Class operations"\r
 "Set-theoretic operations on classes:"\r
+{ $subsection class= }\r
 { $subsection class< }\r
 { $subsection class<= }\r
 { $subsection class-and }\r
index 9f950aa36c9fc3a938b268d82cd2a8e6d3107c55..e1ab50cdcd8b340f09ed4d9dec29b0cb4f5fa696 100644 (file)
@@ -14,7 +14,7 @@ $nl
 }
 "The underlying sequence must implement a generic word:"
 { $subsection resize }
-{ $link "vectors" } ", " { $link "byte-vectors" } " and " { $link "sbufs" } " are implemented using the resizable sequence facility." ;
+{ $link "vectors" } " and " { $link "sbufs" } " are implemented using the resizable sequence facility." ;
 
 ABOUT: "growable"
 
index c951750b342a6cc09f9316bd2840f3ceaa0cc428..0b7d9d008f0bce0138e14ebb66957e0b8871c6eb 100644 (file)
@@ -1,14 +1,13 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien arrays byte-arrays byte-vectors
-definitions generic hashtables kernel math namespaces parser
-lexer sequences strings strings.parser sbufs vectors
-words quotations io assocs splitting classes.tuple
-generic.standard generic.math generic.parser classes io.files
-vocabs classes.parser classes.union
-classes.intersection classes.mixin classes.predicate
-classes.singleton classes.tuple.parser compiler.units
-combinators effects.parser slots ;
+USING: accessors alien arrays byte-arrays definitions generic
+hashtables kernel math namespaces parser lexer sequences strings
+strings.parser sbufs vectors words quotations io assocs
+splitting classes.tuple generic.standard generic.math
+generic.parser classes io.files vocabs classes.parser
+classes.union classes.intersection classes.mixin
+classes.predicate classes.singleton classes.tuple.parser
+compiler.units combinators effects.parser slots ;
 IN: bootstrap.syntax
 
 ! These words are defined as a top-level form, instead of with
@@ -81,7 +80,6 @@ IN: bootstrap.syntax
     "{" [ \ } [ >array ] parse-literal ] define-syntax
     "V{" [ \ } [ >vector ] parse-literal ] define-syntax
     "B{" [ \ } [ >byte-array ] parse-literal ] define-syntax
-    "BV{" [ \ } [ >byte-vector ] parse-literal ] define-syntax
     "H{" [ \ } [ >hashtable ] parse-literal ] define-syntax
     "T{" [ parse-tuple-literal parsed ] define-syntax
     "W{" [ \ } [ first <wrapper> ] parse-literal ] define-syntax