! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs byte-arrays byte-vectors classes
-combinators definitions effects fry generic generic.single
-generic.standard hashtables io.binary io.encodings
-io.streams.string kernel kernel.private math math.parser
-namespaces parser sbufs sequences splitting splitting.private
-strings vectors words ;
+combinators definitions fry generic generic.single
+generic.standard hashtables kernel kernel.private math
+math.parser parser sbufs sequences splitting strings vectors
+words ;
IN: hints
GENERIC: specializer-predicate ( spec -- quot )
-M: class specializer-predicate predicate-def ;
+M: class specializer-predicate '[ _ instance? ] ;
M: object specializer-predicate '[ _ eq? ] ;
"specializer" word-prop ;
: make-specializer ( specs -- quot )
- dup length iota <reversed>
+ dup length <iota> <reversed>
[ (picker) 2array ] 2map
[ drop object eq? ] assoc-reject
[ [ t ] ] [
set-specializer
] each
+{ suffix prefix } [
+ { { string object } { array object } }
+ set-specializer
+] each
+
\ subseq
{ { fixnum fixnum string } { fixnum fixnum array } }
set-specializer
\ assoc-stack { vector } set-specializer
-{ >le >be } [
- { { fixnum fixnum } { bignum fixnum } }
- set-specializer
-] each
-
-{ le> be> } [
- { byte-array } set-specializer
-] each
-
\ base> { string fixnum } set-specializer
M\ hashtable at*