]> gitweb.factorcode.org Git - factor.git/commitdiff
Debugging tree shaker
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 2 Oct 2008 11:41:17 +0000 (06:41 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 2 Oct 2008 11:41:17 +0000 (06:41 -0500)
basis/tools/deploy/shaker/shaker.factor
basis/tools/deploy/shaker/strip-cocoa.factor

index f3177a76e1c0997611949d4e2387bbe72d7cae13..7c02e872091bc762f0b88dc66787fe531d813158 100755 (executable)
@@ -85,8 +85,8 @@ IN: tools.deploy.shaker
             ] change-props drop
         ] each
     ] [
-        "Remaining word properties:" print
-        [ props>> keys ] gather .
+        "Remaining word properties:\n" show
+        [ props>> keys ] gather unparse show
     ] [
         H{ } clone '[
             [ [ _ [ ] cache ] map ] change-props drop
@@ -360,15 +360,21 @@ SYMBOL: deploy-vocab
         init-hooks get values concat %
         ,
         strip-io? [ \ flush , ] unless
-    ] [ ] make "Boot quotation: " write dup . flush
+    ] [ ] make "Boot quotation: " show dup unparse show
     set-boot-quot ;
 
+: init-stripper ( -- )
+    t "quiet" set-global
+    f output-stream set-global ;
+
 : strip ( -- )
-    strip-c-io
+    init-stripper
     strip-libc
     strip-cocoa
     strip-debugger
     strip-init-hooks
+    strip-c-io
+    f 5 setenv ! we can't use the Factor debugger or Factor I/O anymore
     deploy-vocab get vocab-main set-boot-quot*
     stripped-word-props >r
     stripped-globals strip-globals
index 2cf803e2703b26984b156db03b846f4519f4e83d..d5249dc20c076cd165d01739bb82c742a80e9bb1 100755 (executable)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: cocoa cocoa.messages cocoa.application cocoa.nibs assocs
 namespaces kernel kernel.private words compiler.units sequences
-ui ui.cocoa init ;
+init vocabs ;
 IN: tools.deploy.shaker.cocoa
 
 : pool ( obj -- obj' ) \ pool get [ ] cache ;
@@ -23,9 +23,12 @@ IN: cocoa.application
 
 H{ } clone \ pool [
     global [
-        stop-after-last-window? set
+        "stop-after-last-window?" "ui" lookup set
 
-        [ "MiniFactor.nib" load-nib ] cocoa-init-hook set-global
+        "ui.cocoa" vocab [
+            [ "MiniFactor.nib" load-nib ]
+            "cocoa-init-hook" "ui.cocoa" lookup set-global
+        ] when
 
         ! Only keeps those methods that we actually call
         sent-messages get super-sent-messages get assoc-union