USING: alien alien.c-types alien.strings alien.syntax kernel
math sequences namespaces make assocs init accessors
continuations combinators core-foundation
-core-foundation.run-loop io.encodings.utf8 destructors ;
+core-foundation.run-loop core-foundation.run-loop.thread
+io.encodings.utf8 destructors ;
IN: core-foundation.fsevents
-! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
-! FSEventStream API, Leopard only !
-! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
-
: kFSEventStreamCreateFlagUseCFTypes 2 ; inline
: kFSEventStreamCreateFlagWatchRoot 4 ; inline
: start-run-loop-thread ( -- )
[ run-loop-thread t ] "CFRunLoop dispatcher" spawn-server drop ;
-
-[ start-run-loop-thread ] "core-foundation.run-loop" add-init-hook
--- /dev/null
+! Copyright (C) 2008 Slava Pestov
+! See http://factorcode.org/license.txt for BSD license.
+USING: init core-foundation.run-loop ;
+IN: core-foundation.run-loop.thread
+
+! Load this vocabulary if you need a run loop running.
+
+[ start-run-loop-thread ] "core-foundation.run-loop.thread" add-init-hook
+! Copyright (C) 2008 Doug Coleman
+! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types io io.files kernel namespaces random
io.encodings.binary init accessors system ;
IN: random.unix
\ boa [
dup tuple-class? [
dup inlined-dependency depends-on
- [ "boa-check" word-prop ]
+ [ "boa-check" word-prop [ ] or ]
[ tuple-layout '[ _ <tuple-boa> ] ]
bi append
] [ drop f ] if
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 ;
+strings sets vectors quotations byte-arrays sorting ;
QUALIFIED: bootstrap.stage2
QUALIFIED: classes
QUALIFIED: command-line
"cpu.x86" init-hooks get delete-at
"command-line" init-hooks get delete-at
"libc" init-hooks get delete-at
+ "system" init-hooks get delete-at
deploy-threads? get [
"threads" init-hooks get delete-at
] unless
"io.thread" init-hooks get delete-at
] unless
strip-io? [
+ "io.files" init-hooks get delete-at
"io.backend" init-hooks get delete-at
+ ] when
+ strip-dictionary? [
+ "compiler.units" init-hooks get delete-at
] when ;
: strip-debugger ( -- )
: strip-word-props ( stripped-props words -- )
"Stripping word properties" show
[
- [
- props>> swap
- '[ drop _ member? not ] assoc-filter sift-assoc
- dup assoc-empty? [ drop f ] [ >alist >vector ] if
- ] keep (>>props)
- ] with each ;
+ swap '[
+ [
+ [ drop _ member? not ] assoc-filter sift-assoc
+ >alist f like
+ ] change-props drop
+ ] each
+ ] [
+ "Remaining word properties:" print
+ [ props>> keys ] gather .
+ ] bi ;
: stripped-word-props ( -- seq )
[
strip-dictionary? [
{
+ "boa-check"
"cannot-infer"
"coercer"
"combination"
"compiled-generic-uses"
"compiled-uses"
"constraints"
+ "custom-inlining"
"declared-effect"
"default"
"default-method"
"default-output-classes"
"derived-from"
"engines"
+ "forgotten"
+ "identities"
"if-intrinsics"
"infer"
"inferred-effect"
"macro"
"members"
"memo-quot"
+ "mixin"
"method-class"
"method-generic"
"methods"
+ "modular-arithmetic"
"no-compile"
"optimizer-hooks"
"outputs"
"predicate"
"predicate-definition"
"predicating"
+ "primitive"
"reader"
"reading"
"recursive"
compiled-generic-crossref
compiler.units:recompile-hook
compiler.units:update-tuples-hook
+ compiler.units:definition-observers
definitions:crossref
interactive-vocabs
layouts:num-tags
vocabs:dictionary
vocabs:load-vocab-hook
word
+ parser-notes
} %
{ } { "math.partial-dispatch" } strip-vocab-globals %
"ui-error-hook" "ui.gadgets.worlds" lookup ,
] when
- "<computer>" "inference.dataflow" lookup [ , ] when*
+ "<value>" "stack-checker.state" lookup [ , ] when*
"windows-messages" "windows.messages" lookup [ , ] when*
-USING: cocoa cocoa.messages cocoa.application cocoa.nibs
-assocs namespaces kernel words compiler.units sequences
-ui ui.cocoa ;
+! Copyright (C) 2007, 2008 Slava Pestov
+! 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 ;
+IN: tools.deploy.shaker.cocoa
+
+: pool ( obj -- obj' ) \ pool get [ ] cache ;
+
+: pool-array ( obj -- obj' ) [ pool ] map pool ;
+
+: pool-keys ( assoc -- assoc' ) [ [ pool-array ] dip ] assoc-map ;
+
+: pool-values ( assoc -- assoc' ) [ pool-array ] assoc-map ;
+
+IN: cocoa.application
+
+: objc-error ( error -- ) die ;
+
+[ [ die ] 19 setenv ] "cocoa.application" add-init-hook
"stop-after-last-window?" get
-global [
- stop-after-last-window? set
- [ "MiniFactor.nib" load-nib ] cocoa-init-hook set-global
+H{ } clone \ pool [
+ global [
+ stop-after-last-window? set
+
+ [ "MiniFactor.nib" load-nib ] cocoa-init-hook set-global
- ! Only keeps those methods that we actually call
- sent-messages get super-sent-messages get assoc-union
- objc-methods [ assoc-intersect ] change
+ ! Only keeps those methods that we actually call
+ sent-messages get super-sent-messages get assoc-union
+ objc-methods [ assoc-intersect pool-values ] change
- sent-messages get
- super-sent-messages get
- [ keys [ objc-methods get at dup ] H{ } map>assoc ] bi@
- super-message-senders [ assoc-intersect ] change
- message-senders [ assoc-intersect ] change
+ sent-messages get
+ super-sent-messages get
+ [ keys [ objc-methods get at dup ] H{ } map>assoc ] bi@
+ super-message-senders [ assoc-intersect pool-keys ] change
+ message-senders [ assoc-intersect pool-keys ] change
- sent-messages off
- super-sent-messages off
+ sent-messages off
+ super-sent-messages off
- alien>objc-types off
- objc>alien-types off
+ alien>objc-types off
+ objc>alien-types off
- ! We need this for strip-stack-traces to work fully
- { message-senders super-message-senders }
- [ get values compile ] each
-] bind
+ ! We need this for strip-stack-traces to work fully
+ { message-senders super-message-senders }
+ [ get values compile ] each
+ ] bind
+] with-variable
} cond ;
: boa-check-quot ( class -- quot )
- all-slots [ class>> instance-check-quot ] map spread>quot ;
+ all-slots [ class>> instance-check-quot ] map spread>quot
+ f like ;
: define-boa-check ( class -- )
dup boa-check-quot "boa-check" set-word-prop ;
[ (clone) ] [ tuple-layout <tuple> ] ?if ;
M: tuple-class boa
- [ "boa-check" word-prop call ]
+ [ "boa-check" word-prop [ call ] when* ]
[ tuple-layout ]
bi <tuple-boa> ;