Merge branch 'master' of git://github.com/slavapestov/factor
commit
0925f0a5bf
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
unix
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
windows
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2005, 2006 Kevin Reid.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: assocs kernel namespaces cocoa cocoa.classes
|
||||
cocoa.subclassing debugger ;
|
||||
USING: alien.c-types assocs kernel namespaces cocoa
|
||||
cocoa.classes cocoa.runtime cocoa.subclassing debugger ;
|
||||
IN: cocoa.callbacks
|
||||
|
||||
SYMBOL: callbacks
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -76,13 +76,13 @@ MACRO: (send) ( selector super? -- quot )
|
|||
: super-send ( receiver args... selector -- return... ) t (send) ; inline
|
||||
|
||||
! Runtime introspection
|
||||
SYMBOL: class-startup-hooks
|
||||
SYMBOL: class-init-hooks
|
||||
|
||||
class-startup-hooks [ H{ } clone ] initialize
|
||||
class-init-hooks [ H{ } clone ] initialize
|
||||
|
||||
: (objc-class) ( name word -- class )
|
||||
2dup execute dup [ 2nip ] [
|
||||
drop over class-startup-hooks get at [ call( -- ) ] when*
|
||||
drop over class-init-hooks get at [ call( -- ) ] when*
|
||||
2dup execute dup [ 2nip ] [
|
||||
2drop "No such class: " prepend throw
|
||||
] if
|
||||
|
|
@ -229,7 +229,7 @@ ERROR: no-objc-type name ;
|
|||
: class-exists? ( string -- class ) objc_getClass >boolean ;
|
||||
|
||||
: define-objc-class-word ( quot name -- )
|
||||
[ class-startup-hooks get set-at ]
|
||||
[ class-init-hooks get set-at ]
|
||||
[
|
||||
[ "cocoa.classes" create ] [ '[ _ objc-class ] ] bi
|
||||
(( -- class )) define-declared
|
||||
|
|
@ -237,8 +237,10 @@ ERROR: no-objc-type name ;
|
|||
|
||||
: import-objc-class ( name quot -- )
|
||||
over define-objc-class-word
|
||||
[ objc-class register-objc-methods ]
|
||||
[ objc-meta-class register-objc-methods ] bi ;
|
||||
dup objc_getClass [
|
||||
[ objc-class register-objc-methods ]
|
||||
[ objc-meta-class register-objc-methods ] bi
|
||||
] [ drop ] if ;
|
||||
|
||||
: root-class ( class -- root )
|
||||
dup class_getSuperclass [ root-class ] [ ] ?if ;
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
unportable
|
||||
bindings
|
||||
ffi
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
USING: compiler.crossref fry kernel sequences tools.test vocabs words ;
|
||||
IN: compiler.crossref.tests
|
||||
|
||||
! Dependencies of all words should always be satisfied unless we're
|
||||
! in the middle of recompiling something
|
||||
[ { } ] [
|
||||
all-words dup [ subwords ] map concat append
|
||||
H{ } clone '[ _ dependencies-satisfied? not ] filter
|
||||
] unit-test
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
IN: compiler.tests.redefine22
|
||||
USING: kernel sequences compiler.units vocabs tools.test definitions ;
|
||||
|
||||
TUPLE: ttt ;
|
||||
INSTANCE: ttt sequence
|
||||
M: ttt new-sequence 2drop ttt new ;
|
||||
|
||||
: www-1 ( a -- b ) T{ ttt } new-sequence ;
|
||||
|
||||
! This used to break with a compiler error in the above word
|
||||
[ ] [ [ \ ttt forget ] with-compilation-unit ] unit-test
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
IN: compiler.tests.redefine23
|
||||
USING: classes.struct specialized-arrays alien.c-types sequences
|
||||
compiler.units vocabs tools.test ;
|
||||
|
||||
STRUCT: my-struct { x int } ;
|
||||
SPECIALIZED-ARRAY: my-struct
|
||||
: my-word ( a -- b ) iota [ my-struct <struct-boa> ] my-struct-array{ } map-as ;
|
||||
|
||||
[ ] [
|
||||
[
|
||||
"specialized-arrays.instances.compiler.tests.redefine23" forget-vocab
|
||||
] with-compilation-unit
|
||||
] unit-test
|
||||
|
|
@ -51,11 +51,16 @@ GENERIC: cleanup* ( node -- node/nodes )
|
|||
[ in-d>> #drop ]
|
||||
bi prefix ;
|
||||
|
||||
: record-predicate-folding ( #call -- )
|
||||
[ node-input-infos first class>> ]
|
||||
: >predicate-folding< ( #call -- value-info class result )
|
||||
[ node-input-infos first ]
|
||||
[ word>> "predicating" word-prop ]
|
||||
[ node-output-infos first literal>> ] tri
|
||||
[ depends-on-class<= ] [ depends-on-classes-disjoint ] if ;
|
||||
[ node-output-infos first literal>> ] tri ;
|
||||
|
||||
: record-predicate-folding ( #call -- )
|
||||
>predicate-folding< pick literal?>>
|
||||
[ [ literal>> ] 2dip depends-on-instance-predicate ]
|
||||
[ [ class>> ] 2dip depends-on-class-predicate ]
|
||||
if ;
|
||||
|
||||
: record-folding ( #call -- )
|
||||
dup word>> predicate?
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
! Copyright (C) 2008, 2009 Slava Pestov.
|
||||
! Copyright (C) 2008, 2010 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: assocs classes classes.algebra classes.tuple
|
||||
classes.tuple.private kernel accessors math math.intervals namespaces
|
||||
sequences sequences.private words combinators memoize
|
||||
combinators.short-circuit byte-arrays strings arrays layouts
|
||||
cpu.architecture compiler.tree.propagation.copy ;
|
||||
classes.tuple.private classes.singleton kernel accessors math
|
||||
math.intervals namespaces sequences sequences.private words
|
||||
combinators memoize combinators.short-circuit byte-arrays
|
||||
strings arrays layouts cpu.architecture
|
||||
compiler.tree.propagation.copy ;
|
||||
IN: compiler.tree.propagation.info
|
||||
|
||||
: false-class? ( class -- ? ) \ f class<= ;
|
||||
|
|
@ -65,9 +66,17 @@ DEFER: <literal-info>
|
|||
|
||||
UNION: fixed-length array byte-array string ;
|
||||
|
||||
: literal-class ( obj -- class )
|
||||
#! Handle forgotten tuples and singleton classes properly
|
||||
dup singleton-class? [
|
||||
class dup class? [
|
||||
drop tuple
|
||||
] unless
|
||||
] unless ;
|
||||
|
||||
: init-literal-info ( info -- info )
|
||||
empty-interval >>interval
|
||||
dup literal>> class >>class
|
||||
dup literal>> literal-class >>class
|
||||
dup literal>> {
|
||||
{ [ dup real? ] [ [a,a] >>interval ] }
|
||||
{ [ dup tuple? ] [ tuple-slot-infos >>slots ] }
|
||||
|
|
|
|||
|
|
@ -648,7 +648,7 @@ M: array iterate first t ; inline
|
|||
] final-info drop
|
||||
] unit-test
|
||||
|
||||
[ V{ word } ] [
|
||||
[ V{ t } ] [
|
||||
[ { hashtable } declare hashtable instance? ] final-classes
|
||||
] unit-test
|
||||
|
||||
|
|
@ -660,7 +660,7 @@ M: array iterate first t ; inline
|
|||
[ { assoc } declare hashtable instance? ] final-classes
|
||||
] unit-test
|
||||
|
||||
[ V{ word } ] [
|
||||
[ V{ t } ] [
|
||||
[ { string } declare string? ] final-classes
|
||||
] unit-test
|
||||
|
||||
|
|
@ -774,7 +774,7 @@ MIXIN: empty-mixin
|
|||
[ { fixnum } declare log2 ] final-classes
|
||||
] unit-test
|
||||
|
||||
[ V{ word } ] [
|
||||
[ V{ t } ] [
|
||||
[ { fixnum } declare log2 0 >= ] final-classes
|
||||
] unit-test
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
! Copyright (C) 2008, 2009 Slava Pestov.
|
||||
! Copyright (C) 2008, 2010 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: fry accessors kernel sequences sequences.private assocs
|
||||
words namespaces classes.algebra combinators
|
||||
|
|
@ -93,11 +93,8 @@ M: #declare propagate-before
|
|||
recover ;
|
||||
|
||||
: predicate-output-infos/class ( info class -- info )
|
||||
[ class>> ] dip {
|
||||
{ [ 2dup class<= ] [ t <literal-info> ] }
|
||||
{ [ 2dup classes-intersect? not ] [ f <literal-info> ] }
|
||||
[ object-info ]
|
||||
} cond 2nip ;
|
||||
[ class>> ] dip compare-classes
|
||||
dup +incomparable+ eq? [ drop object-info ] [ <literal-info> ] if ;
|
||||
|
||||
: predicate-output-infos ( info class -- info )
|
||||
over literal?>>
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
macosx
|
||||
|
|
@ -1,2 +1 @@
|
|||
unportable
|
||||
bindings
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
unportable
|
||||
compiler
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
unportable
|
||||
untested
|
||||
compiler
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
unportable
|
||||
untested
|
||||
compiler
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
unportable
|
||||
untested
|
||||
compiler
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
windows
|
||||
|
|
@ -1 +0,0 @@
|
|||
unportable
|
||||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
unportable
|
||||
untested
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue