diff --git a/library/compiler/optimizer/inline-methods.factor b/library/compiler/optimizer/inline-methods.factor index 2bb9c0292f..3e4e92cad9 100644 --- a/library/compiler/optimizer/inline-methods.factor +++ b/library/compiler/optimizer/inline-methods.factor @@ -67,11 +67,8 @@ words ; : will-inline-method ( node -- quot/t ) #! t indicates failure - dup inlining-class dup [ - swap node-param "methods" word-prop hash - ] [ - 2drop t - ] if ; + dup inlining-class dup + [ swap node-param method ] [ 2drop t ] if ; : inline-standard-method ( node -- node ) dup will-inline-method (inline-method) ; diff --git a/library/generic/generic.factor b/library/generic/generic.factor index 0d5c44b7b1..53d5edee68 100644 --- a/library/generic/generic.factor +++ b/library/generic/generic.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. IN: generic -USING: words kernel sequences namespaces ; +USING: words kernel sequences namespaces hashtables ; PREDICATE: compound generic ( word -- ? ) "combination" word-prop ; @@ -28,3 +28,6 @@ M: generic definer drop \ G: ; bootstrap-combination dupd "combination" set-word-prop dup init-methods ?make-generic ; + +: generic-tags ( word -- seq ) + "methods" word-prop hash-keys [ types ] map concat prune ; diff --git a/library/generic/math-combination.factor b/library/generic/math-combination.factor index 9b00e4cd73..9deafc4e6c 100644 --- a/library/generic/math-combination.factor +++ b/library/generic/math-combination.factor @@ -37,8 +37,7 @@ TUPLE: no-math-method left right generic ; 3dup throw ; : applicable-method ( generic class -- quot ) - over "methods" word-prop hash - [ ] [ [ no-math-method ] curry ] ?if ; + over method [ ] [ [ no-math-method ] curry ] ?if ; : object-method ( generic -- quot ) object bootstrap-word applicable-method ; diff --git a/library/generic/methods.factor b/library/generic/methods.factor index c39a2d899b..78f587736f 100644 --- a/library/generic/methods.factor +++ b/library/generic/methods.factor @@ -3,6 +3,9 @@ IN: generic USING: words hashtables sequences arrays errors kernel ; +: method ( class generic -- quot ) + "methods" word-prop hash ; + : methods ( generic -- alist ) "methods" word-prop hash>alist [ [ first ] 2apply class-compare ] sort ; diff --git a/library/generic/standard-combination.factor b/library/generic/standard-combination.factor index c69a6e975c..4e8b60f5f5 100644 --- a/library/generic/standard-combination.factor +++ b/library/generic/standard-combination.factor @@ -76,9 +76,6 @@ TUPLE: no-method object generic ; : big-generic ( dispatch# word n dispatcher -- def ) [ >r pick picker % r> , , \ dispatch , ] [ ] make ; -: generic-tags ( word -- seq ) - "methods" word-prop hash-keys [ types ] map concat prune ; - : tag-generic? ( word -- ? ) #! If all the types we dispatch upon can be identified #! based on tag alone, we change the dispatcher primitive diff --git a/library/syntax/see.factor b/library/syntax/see.factor index c89bc57615..d63e208d6f 100644 --- a/library/syntax/see.factor +++ b/library/syntax/see.factor @@ -12,7 +12,7 @@ M: compound definition word-def t ; M: generic definition "combination" word-prop t ; -M: method-spec definition first2 "methods" word-prop hash t ; +M: method-spec definition first2 method t ; GENERIC: see ( spec -- ) @@ -54,6 +54,8 @@ M: generic see-methods* M: class see-methods* dup implementors [ 2array ] map-with ; +M: word see-methods* drop f ; + : see-methods ( word -- ) see-methods* [ see ] each ;