Untangling more dependencies

db4
Slava Pestov 2008-12-08 16:02:31 -06:00
parent ba6f63ff56
commit 7940020491
18 changed files with 90 additions and 79 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2005, 2008 Slava Pestov, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays calendar combinators generic init
kernel math namespaces sequences heaps boxes threads debugger
kernel math namespaces sequences heaps boxes threads
quotations assocs math.order ;
IN: alarms

View File

@ -1,7 +1,11 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: vocabs vocabs.loader kernel ;
IN: bootstrap.threads
USE: io.thread
USE: threads
USE: debugger.threads
"debugger" vocab [
"debugger.threads" require
] when

View File

@ -1,9 +1,9 @@
! Copyright (C) 2006, 2007 Slava Pestov
! Copyright (C) 2006, 2008 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax io kernel namespaces core-foundation
core-foundation.run-loop cocoa.messages cocoa cocoa.classes
cocoa.runtime sequences threads debugger init summary
kernel.private assocs ;
cocoa.runtime sequences threads init summary kernel.private
assocs ;
IN: cocoa.application
: <NSString> ( str -- alien ) <CFString> -> autorelease ;

View File

@ -2,21 +2,17 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.c-types alien.strings arrays assocs
continuations combinators compiler compiler.alien kernel math
namespaces make parser prettyprint prettyprint.sections
quotations sequences strings words cocoa.runtime io macros
memoize debugger io.encodings.ascii effects libc libc.private
parser lexer init core-foundation fry generalizations
specialized-arrays.direct.alien ;
namespaces make parser quotations sequences strings words
cocoa.runtime io macros memoize io.encodings.ascii
effects libc libc.private parser lexer init core-foundation fry
generalizations specialized-arrays.direct.alien ;
IN: cocoa.messages
: make-sender ( method function -- quot )
[ over first , f , , second , \ alien-invoke , ] [ ] make ;
: sender-stub-name ( method function -- string )
[ % "_" % unparse % ] "" make ;
: sender-stub ( method function -- word )
[ sender-stub-name f <word> dup ] 2keep
[ "( sender-stub )" f <word> dup ] 2dip
over first large-struct? [ "_stret" append ] when
make-sender define ;
@ -78,12 +74,8 @@ MACRO: (send) ( selector super? -- quot )
: send ( receiver args... selector -- return... ) f (send) ; inline
\ send soft "break-after" set-word-prop
: super-send ( receiver args... selector -- return... ) t (send) ; inline
\ super-send soft "break-after" set-word-prop
! Runtime introspection
SYMBOL: class-init-hooks
@ -216,17 +208,6 @@ assoc-union alien>objc-types set-global
: register-objc-methods ( class -- )
[ register-objc-method ] each-method-in-class ;
: method. ( method -- )
{
[ method_getName sel_getName ]
[ method-return-type ]
[ method-arg-types ]
[ method_getImplementation ]
} cleave 4array . ;
: methods. ( class -- )
[ method. ] each-method-in-class ;
: class-exists? ( string -- class ) objc_getClass >boolean ;
: define-objc-class-word ( quot name -- )
@ -238,11 +219,8 @@ assoc-union alien>objc-types set-global
: import-objc-class ( name quot -- )
over define-objc-class-word
'[
_
[ objc-class register-objc-methods ]
[ objc-meta-class register-objc-methods ] bi
] try ;
[ objc-class register-objc-methods ]
[ objc-meta-class register-objc-methods ] bi ;
: root-class ( class -- root )
dup class_getSuperclass [ root-class ] [ ] ?if ;

View File

@ -1,9 +1,9 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel locals.private quotations classes.tuple make
combinators generic words interpolate namespaces sequences
io.streams.string fry classes.mixin effects lexer parser
classes.tuple.parser effects.parser ;
USING: kernel quotations classes.tuple make combinators generic
words interpolate namespaces sequences io.streams.string fry
classes.mixin effects lexer parser classes.tuple.parser
effects.parser locals.types locals.parser locals.rewrite.closures ;
IN: functors
: scan-param ( -- obj )
@ -101,6 +101,6 @@ DEFER: ;FUNCTOR delimiter
CREATE
parse-locals
parse-functor-body swap pop-locals <lambda>
lambda-rewrite first ;
rewrite-closures first ;
: FUNCTOR: (FUNCTOR:) define ; parsing

View File

@ -1,7 +1,7 @@
USING: help help.markup help.syntax help.definitions help.topics
namespaces words sequences classes assocs vocabs kernel arrays
prettyprint.backend kernel.private io generic math system
strings sbufs vectors byte-arrays quotations
prettyprint.backend prettyprint.custom kernel.private io generic
math system strings sbufs vectors byte-arrays quotations
io.streams.byte-array classes.builtin parser lexer
classes.predicate classes.union classes.intersection
classes.singleton classes.tuple tools.vocabs.browser math.parser

View File

@ -10,7 +10,7 @@ sequences sequences.private slots.private strings
strings.private system threads.private classes.tuple
classes.tuple.private vectors vectors.private words definitions
words.private assocs summary compiler.units system.private
combinators locals locals.backend locals.private words.private
combinators locals locals.backend locals.types words.private
quotations.private stack-checker.values
stack-checker.alien
stack-checker.state

View File

@ -0,0 +1,16 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays cocoa.messages cocoa.runtime combinators
prettyprint ;
IN: tools.cocoa
: method. ( method -- )
{
[ method_getName sel_getName ]
[ method-return-type ]
[ method-arg-types ]
[ method_getImplementation ]
} cleave 4array . ;
: methods. ( class -- )
[ method. ] each-method-in-class ;

View File

@ -0,0 +1 @@
unportable

View File

@ -89,7 +89,8 @@ DEFER: ?make-staging-image
[ drop ] [ make-staging-image ] if ;
: make-deploy-config ( vocab -- file )
[ deploy-config unparse-use ] [ "deploy-config-" prepend ] bi
[ deploy-config unparse-use ]
[ "deploy-config-" prepend temp-file ] bi
[ utf8 set-file-contents ] keep ;
: deploy-command-line ( image vocab config -- flags )

View File

@ -31,6 +31,10 @@ urls math.parser ;
[ t ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test
os macosx? [
[ t ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test
] when
: run-temp-image ( -- )
vm
"-i=" "test.image" temp-file append

View File

@ -1,10 +1,11 @@
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: io io.files kernel namespaces make sequences
system tools.deploy.backend tools.deploy.config assocs
hashtables prettyprint io.unix.backend cocoa io.encodings.utf8
io.backend cocoa.application cocoa.classes cocoa.plists
qualified combinators ;
USING: io io.files kernel namespaces make sequences system
tools.deploy.backend tools.deploy.config
tools.deploy.config.editor assocs hashtables prettyprint
io.unix.backend cocoa io.encodings.utf8 io.backend
cocoa.application cocoa.classes cocoa.plists qualified
combinators ;
IN: tools.deploy.macosx
: bundle-dir ( -- dir )

View File

@ -25,11 +25,6 @@ H{ } clone \ pool [
global [
"stop-after-last-window?" "ui" lookup set
"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
objc-methods [ assoc-intersect pool-values ] change

View File

@ -3,9 +3,10 @@
USING: accessors math arrays assocs cocoa cocoa.application
command-line kernel memory namespaces cocoa.messages
cocoa.runtime cocoa.subclassing cocoa.pasteboard cocoa.types
cocoa.windows cocoa.classes cocoa.application sequences system
ui ui.backend ui.clipboards ui.gadgets ui.gadgets.worlds
ui.cocoa.views core-foundation threads math.geometry.rect fry ;
cocoa.windows cocoa.classes cocoa.application cocoa.nibs
sequences system ui ui.backend ui.clipboards ui.gadgets
ui.gadgets.worlds ui.cocoa.views core-foundation threads
math.geometry.rect fry ;
IN: ui.cocoa
TUPLE: handle view window ;
@ -110,7 +111,9 @@ CLASS: {
SYMBOL: cocoa-init-hook
cocoa-init-hook global [ [ install-app-delegate ] or ] change-at
cocoa-init-hook global [
[ "MiniFactor.nib" load-nib install-app-delegate ] or
] change-at
M: cocoa-ui-backend ui
"UI" assert.app [

View File

@ -1,11 +1,11 @@
! Copyright (C) 2007 Slava Pestov.
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: ui.gadgets colors kernel ui.render namespaces models
models.mapping sequences ui.gadgets.buttons ui.gadgets.packs
ui.gadgets.labels tools.deploy.config namespaces
ui.gadgets.editors ui.gadgets.borders ui.gestures ui.commands
assocs ui.gadgets.tracks ui ui.tools.listener tools.deploy
vocabs ui.tools.workspace system accessors fry ;
ui.gadgets.labels tools.deploy.config tools.deploy.config.editor
namespaces ui.gadgets.editors ui.gadgets.borders ui.gestures
ui.commands assocs ui.gadgets.tracks ui ui.tools.listener
tools.deploy vocabs ui.tools.workspace system accessors fry ;
IN: ui.tools.deploy
TUPLE: deploy-gadget < pack vocab settings ;

View File

@ -0,0 +1,18 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: debugger prettyprint accessors io ;
IN: unix.debugger
M: unix-error error.
"Unix system call failed:" print
nl
dup message>> write " (" write errno>> pprint ")" print ;
M: unix-system-call-error error.
"Unix system call ``" write dup word>> pprint "'' failed:" print
nl
dup message>> write " (" write dup errno>> pprint ")" print
nl
"It was called with the following arguments:" print
nl
args>> stack. ;

View File

@ -1,10 +1,10 @@
! Copyright (C) 2005, 2007 Slava Pestov.
! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types alien.syntax kernel libc
sequences continuations byte-arrays strings math namespaces
system combinators vocabs.loader qualified accessors
stack-checker macros locals generalizations unix.types
debugger io prettyprint io.files ;
io io.files vocabs vocabs.loader ;
IN: unix
: PROT_NONE 0 ; inline
@ -60,26 +60,12 @@ FUNCTION: char* strerror ( int errno ) ;
ERROR: unix-error errno message ;
M: unix-error error.
"Unix system call failed:" print
nl
dup message>> write " (" write errno>> pprint ")" print ;
: (io-error) ( -- * ) err_no dup strerror unix-error ;
: io-error ( n -- ) 0 < [ (io-error) ] when ;
ERROR: unix-system-call-error args errno message word ;
M: unix-system-call-error error.
"Unix system call ``" write dup word>> pprint "'' failed:" print
nl
dup message>> write " (" write dup errno>> pprint ")" print
nl
"It was called with the following arguments:" print
nl
args>> stack. ;
MACRO:: unix-system-call ( quot -- )
[let | n [ quot infer in>> ]
word [ quot first ] |
@ -236,3 +222,7 @@ FUNCTION: ssize_t write ( int fd, void* buf, size_t nbytes ) ;
{ [ os bsd? ] [ "unix.bsd" require ] }
{ [ os solaris? ] [ "unix.solaris" require ] }
} cond
"debugger" vocab [
"unix.debugger" require
] when

View File

@ -78,7 +78,7 @@ M: pathname forget*
SYMBOL: file
TUPLE: source-file-error file error ;
TUPLE: source-file-error error file ;
: <source-file-error> ( msg -- error )
\ source-file-error new