diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index c48b0a5224..e815d6fa9f 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -22,7 +22,6 @@ - amd64 crash - get factor running on mac intel - constant branch folding -- new objc syntax + refactor style stack code so that nested styles are handled at a lower-level - in HTML, we can nest div tags, etc diff --git a/library/generic/standard-combination.factor b/library/generic/standard-combination.factor index 8231dfb9ac..e7a7509773 100644 --- a/library/generic/standard-combination.factor +++ b/library/generic/standard-combination.factor @@ -76,12 +76,16 @@ TUPLE: no-method object generic ; : big-generic ( dispatch# word n dispatcher -- def ) [ >r pick picker % r> , , \ dispatch , ] [ ] make ; -: tag-generic? ( word -- ? ) - "methods" word-prop hash-keys [ types ] map concat - [ tag-mask < ] all? ; +: generic-tags ( word -- seq ) + "methods" word-prop hash-keys [ types ] map concat prune ; -: small-generic? ( word -- ? ) - "methods" word-prop hash-size 3 <= ; +: tag-generic? ( word -- ? ) + #! If all the types we dispatch upon can be identified + #! based on tag alone, we change the dispatcher primitive + #! from 'type' to 'tag'. + generic-tags [ tag-mask < ] all? ; + +: small-generic? ( word -- ? ) generic-tags length 3 <= ; : standard-combination ( word dispatch# -- quot ) swap { diff --git a/library/ui/cocoa/utilities.factor b/library/ui/cocoa/utilities.factor index f2420dd7e3..a2bdb57813 100644 --- a/library/ui/cocoa/utilities.factor +++ b/library/ui/cocoa/utilities.factor @@ -91,9 +91,6 @@ H{ } clone objc-methods set-global : infer-send ( super? -- ) pop-literal rot make-objc-send infer-quot-value ; -: compile-send-error - "Objective C message sends must be compiled" throw ; - : (send) ( ... selector super? -- ... ) make-objc-send dup peek compile call ;