]> gitweb.factorcode.org Git - factor.git/commitdiff
generic: rename method-body predicate class to method
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 1 Feb 2010 07:08:24 +0000 (20:08 +1300)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 3 Feb 2010 10:11:24 +0000 (23:11 +1300)
20 files changed:
basis/compiler/compiler.factor
basis/compiler/tests/redefine0.factor
basis/compiler/tests/redefine13.factor
basis/compiler/tests/stack-trace.factor
basis/compiler/tree/debugger/debugger.factor
basis/delegate/delegate.factor
basis/functors/functors.factor
basis/hints/hints.factor
basis/locals/definitions/definitions.factor
basis/prettyprint/backend/backend.factor
basis/prettyprint/prettyprint.factor
basis/see/see.factor
basis/tools/crossref/crossref.factor
basis/ui/tools/listener/completion/completion.factor
basis/ui/tools/profiler/profiler.factor
core/generic/generic-docs.factor
core/generic/generic-tests.factor
core/generic/generic.factor
core/slots/slots.factor
extra/mason/test/test.factor

index 5be2b0de8744626cfa38a0f341410d11be7edcd2..f83eab7fb053d5815358f20ef6c9f2ddd25163d5 100644 (file)
@@ -54,7 +54,7 @@ SYMBOL: compiled
 
 GENERIC: no-compile? ( word -- ? )
 
-M: method-body no-compile? "method-generic" word-prop no-compile? ;
+M: method no-compile? "method-generic" word-prop no-compile? ;
 
 M: predicate-engine-word no-compile? "owner-generic" word-prop no-compile? ;
 
@@ -63,7 +63,7 @@ M: word no-compile?
 
 GENERIC: combinator? ( word -- ? )
 
-M: method-body combinator? "method-generic" word-prop combinator? ;
+M: method combinator? "method-generic" word-prop combinator? ;
 
 M: predicate-engine-word combinator? "owner-generic" word-prop combinator? ;
 
index 4de6d952c8fce6156067fc8e2c929aff49314614..ff928fee286c7e6ef6f2da8e69468405d44f36a2 100644 (file)
@@ -77,8 +77,8 @@ M: integer test-7 + ;
 ! Indirect dependency on an unoptimized word
 : test-9 ( -- ) ;
 << SYMBOL: quot
-[ test-9 ] quot set-global >>
-MACRO: test-10 ( -- quot ) quot get ;
+[ test-9 ] quot set-global
+MACRO: test-10 ( -- quot ) quot get ; >>
 : test-11 ( -- ) test-10 ;
 
 [ ] [ test-11 ] unit-test
index d092cd4ee1976210bea498d1969894beda66ed85..1befdd5b5db5f0a4ad0b67fa13e89285d5fd16b3 100644 (file)
@@ -3,7 +3,7 @@ IN: compiler.tests.redefine13
 
 : breakage-word ( a b -- c ) + ;
 
-MACRO: breakage-macro ( a -- ) '[ _ breakage-word ] ;
+<< MACRO: breakage-macro ( a -- ) '[ _ breakage-word ] ; >>
 
 GENERIC: breakage-caller ( a -- c )
 
index 40aa1bb336ad3d462c451b2013fe8b458aea68fd..3d31245168a1142ec0600fc1ce1f4d695b027534 100644 (file)
@@ -5,7 +5,7 @@ IN: compiler.tests.stack-trace
 
 : symbolic-stack-trace ( -- newseq )
     error-continuation get call>> callstack>array
-    2 group flip first ;
+    3 group flip first ;
 
 : foo ( -- * ) 3 throw 7 ;
 : bar ( -- * ) foo 4 ;
index fd2962bb161ddeac2e619cc84430ebc26c2abfed..c9b60922bd97531b19974dc6d51e5a8fa0a51ad6 100644 (file)
@@ -159,7 +159,7 @@ SYMBOL: node-count
                 word>> {
                     { [ dup "intrinsic" word-prop ] [ intrinsics-called ] }
                     { [ dup generic? ] [ generics-called ] }
-                    { [ dup method-body? ] [ methods-called ] }
+                    { [ dup method? ] [ methods-called ] }
                     [ words-called ]
                 } cond get inc-at
             ] [ drop ] if
index fe6ea03794f01fa5e9578ee4c789260dbc3e2ee2..d033b7115bb28f252faba92c49d387ce483a2ab0 100644 (file)
@@ -39,7 +39,7 @@ TUPLE: consultation group class quot loc ;
     [ class>> swap first create-method dup fake-definition ] keep
     [ drop ] [ "consultation" set-word-prop ] 2bi ;
 
-PREDICATE: consult-method < method-body "consultation" word-prop ;
+PREDICATE: consult-method < method "consultation" word-prop ;
 
 M: consult-method reset-word
     [ call-next-method ] [ f "consultation" set-word-prop ] bi ;
index a03463e91171fa2447daf3d5960ab47bc7882a83..ac2e52f68eb415e940bd2b10cc8cc9383b37540b 100644 (file)
@@ -37,7 +37,7 @@ M: array (fake-quotations>)
     [ [ (fake-quotations>) ] each ] { } make , ;
 
 M: fake-call-next-method (fake-quotations>)
-    drop method-body get literalize , \ (call-next-method) , ;
+    drop \ method get literalize , \ (call-next-method) , ;
 
 M: object (fake-quotations>) , ;
 
@@ -74,7 +74,7 @@ FUNCTOR-SYNTAX: MIXIN:
 FUNCTOR-SYNTAX: M:
     scan-param suffix!
     scan-param suffix!
-    [ create-method-in dup method-body set ] append! 
+    [ create-method-in dup \ method set ] append!
     parse-definition*
     \ define* suffix! ;
 
index 7a3fa323d216cf91885c629480a1e0185a935950..62d97b478ced20ccbe2f006799700264e27c8cc7 100644 (file)
@@ -52,7 +52,7 @@ M: object specializer-declaration class ;
     specializer [ specialize-quot ] when* ;
 
 : standard-method? ( method -- ? )
-    dup method-body? [
+    dup method? [
         "method-generic" word-prop standard-generic?
     ] [ drop f ] if ;
 
index a4299d0684642f3855dd8f7095071f2b8702a049..6fc715ba8d0a84d5cfcb70f5758ecfe75d050289 100644 (file)
@@ -24,7 +24,7 @@ M: lambda-macro definition
 M: lambda-macro reset-word
     [ call-next-method ] [ f "lambda" set-word-prop ] bi ;
 
-INTERSECTION: lambda-method method-body lambda-word ;
+INTERSECTION: lambda-method method lambda-word ;
 
 M: lambda-method definer drop \ M:: \ ; ;
 
index 04617a6c672cfeed553a89cbcaede6f22bb91e0a..11d97a5118dc8b690e8fb994c138326c9ae70a93 100644 (file)
@@ -37,7 +37,7 @@ M: parsing-word pprint*
 M: word pprint*
     [ pprint-word ] [ ?start-group ] [ ?end-group ] tri ;
 
-M: method-body pprint*
+M: method pprint*
     [
         [
             [ "M\\ " % "method-class" word-prop word-name* % ]
@@ -229,7 +229,7 @@ M: compose pprint* pprint-object ;
 
 M: wrapper pprint*
     {
-        { [ dup wrapped>> method-body? ] [ wrapped>> pprint* ] }
+        { [ dup wrapped>> method? ] [ wrapped>> pprint* ] }
         { [ dup wrapped>> word? ] [ <block \ \ pprint-word wrapped>> pprint-word block> ] }
         [ pprint-object ]
     } cond ;
index ccc77068e6f45527a504ca41bbf5af6adbcec687..7582f3248d91eae77e6bc6ddb5e67fb1e52d57d7 100644 (file)
@@ -78,7 +78,7 @@ SYMBOL: ->
     first3
     [
         {
-            { [ dup method-body? ] [ "Method: " write . ] }
+            { [ dup method? ] [ "Method: " write . ] }
             { [ dup word? ] [ "Word: " write . ] }
             [ drop ]
         } cond
index 51d3971c38e267c0da26ba7f43778009ec951bff..0d2388114a43c165cb67bbb217b1f10d50fb91cb 100644 (file)
@@ -76,7 +76,7 @@ M: hook-generic synopsis*
         [ stack-effect. ]
     } cleave ;
 
-M: method-body synopsis*
+M: method synopsis*
     [ definer. ]
     [ "method-class" word-prop pprint-word ]
     [ "method-generic" word-prop pprint-word ] tri ;
index daa30100a46e30c64913534b462380403a026359..3bdf2f83ae589a46148f8849d8c7255d4c186ca0 100644 (file)
@@ -103,7 +103,7 @@ GENERIC: smart-usage ( defspec -- seq )
 
 M: object smart-usage usage [ irrelevant? not ] filter ;
 
-M: method-body smart-usage "method-generic" word-prop smart-usage ;
+M: method smart-usage "method-generic" word-prop smart-usage ;
 
 M: f smart-usage drop \ f smart-usage ;
 
@@ -124,7 +124,7 @@ M: f smart-usage drop \ f smart-usage ;
     [ [ vocab-name ] [ words [ generic? not ] filter ] bi ] dip map
     [
         [ [ word? ] [ generic? not ] bi and ] filter [
-            dup method-body?
+            dup method?
             [ "method-generic" word-prop ] when
             vocabulary>>
         ] map
index b069de18872356e58872ff56bdbd4e5f9c2702a6..391cce7a9e98dc127e2745ddc26df43f3bf918f5 100644 (file)
@@ -119,7 +119,7 @@ M: object completion-string present ;
 : method-completion-string ( word -- string )
     "method-generic" word-prop present ;
 
-M: method-body completion-string method-completion-string ;
+M: method completion-string method-completion-string ;
 
 GENERIC# accept-completion-hook 1 ( item popup -- )
 
index 3de7c9cc702f6d7bf0b730589e8fbff0432473f3..462ea201e6089747d48ec7bd1ca941dcdc7cb7c6 100644 (file)
@@ -60,7 +60,7 @@ SINGLETON: method-renderer
 M: method-renderer column-alignment drop { 0 0 1 } ;
 M: method-renderer filled-column drop 1 ;
 
-! Value is a { method-body count } pair
+! Value is a { method count } pair
 M: method-renderer row-columns
     drop [
         [ [ definition-icon <image-name> ] [ synopsis ] bi ]
index 4b78f22f04a22548ff278bcab39efee4d984a3a0..3a9314fb5645016729ddeab0f0c75598aae41e67 100644 (file)
@@ -131,12 +131,10 @@ HELP: M\
 { $class-description "Pushes a method on the stack." }
 { $examples { $code "M\\ fixnum + see" } { $code "USING: ui.gadgets ui.gadgets.editors ;" "M\\ editor draw-gadget* edit" } } ;
 
-HELP: method-body
-{ $class-description "The class of method bodies, which are words with special word properties set." } ;
-
 HELP: method
-{ $values { "class" class } { "generic" generic } { "method/f" { $maybe method-body } } }
-{ $description "Looks up a method definition." } ;
+{ $values { "class" class } { "generic" generic } { "method/f" { $maybe method } } }
+{ $description "Looks up a method definition." }
+{ $class-description "The class of method bodies, which are words with special word properties set." } ;
 
 { method create-method POSTPONE: M: } related-words
 
@@ -159,14 +157,14 @@ HELP: with-methods
 $low-level-note ;
 
 HELP: create-method
-{ $values { "class" class } { "generic" generic } { "method" method-body } }
+{ $values { "class" class } { "generic" generic } { "method" method } }
 { $description "Creates a method or returns an existing one. This is the runtime equivalent of " { $link POSTPONE: M: } "." }
 { $notes "To define a method, pass the output value to " { $link define } "." } ;
 
 { sort-classes order } related-words
 
 HELP: (call-next-method)
-{ $values { "method" method-body } }
+{ $values { "method" method } }
 { $description "Low-level word implementing " { $link POSTPONE: call-next-method } "." }
 { $notes "In most cases, " { $link POSTPONE: call-next-method } " should be used instead." } ;
 
index ff38ee39ea5d61d14835d1a773651a509d720b90..700448805c0022f505f9c11ee6edc358c464c6f8 100644 (file)
@@ -207,7 +207,7 @@ M: integer forget-test 3 + ;
 [ ] [ "IN: generic.tests USE: math FORGET: M\\ integer forget-test" eval( -- ) ] unit-test
 
 [ { } ] [
-    \ + effect-dependencies-of keys [ method-body? ] filter
+    \ + effect-dependencies-of keys [ method? ] filter
     [ "method-generic" word-prop \ forget-test eq? ] filter
 ] unit-test
 
index 62ff40acfcdcacb38b099f7516b5b18288e17a44..9fd7a5be853e0ba9fc06d05319681327b08d9912 100644 (file)
@@ -21,6 +21,9 @@ M: generic definition drop f ;
     [ dup "combination" word-prop perform-combination ]
     bi ;
 
+PREDICATE: method < word
+    "method-generic" word-prop >boolean ;
+
 : method ( class generic -- method/f )
     "methods" word-prop at ;
 
@@ -101,16 +104,13 @@ GENERIC: update-generic ( class generic -- )
 : method-word-name ( class generic -- string )
     [ name>> ] bi@ "=>" glue ;
 
-PREDICATE: method-body < word
-    "method-generic" word-prop >boolean ;
-
-M: method-body flushable?
+M: method flushable?
     "method-generic" word-prop flushable? ;
 
-M: method-body stack-effect
+M: method stack-effect
     "method-generic" word-prop stack-effect ;
 
-M: method-body crossref?
+M: method crossref?
     "forgotten" word-prop not ;
 
 : method-word-props ( class generic -- assoc )
@@ -150,10 +150,10 @@ PREDICATE: default-method < word "default" word-prop ;
     dupd <default-method> "default-method" set-word-prop ;
 
 ! Definition protocol
-M: method-body definer
+M: method definer
     drop \ M: \ ; ;
 
-M: method-body forget*
+M: method forget*
     dup "forgotten" word-prop [ drop ] [
         [
             dup default-method? [ drop ] [
index 7b977482496a4d95e5c2872dc8c569b0b682ec37..f6bd13cf6d2426fe409e346d63b468cd50cb5647 100644 (file)
@@ -10,11 +10,11 @@ TUPLE: slot-spec name offset class initial read-only ;
 
 PREDICATE: reader < word "reader" word-prop ;
 
-PREDICATE: reader-method < method-body "reading" word-prop ;
+PREDICATE: reader-method < method "reading" word-prop ;
 
 PREDICATE: writer < word "writer" word-prop ;
 
-PREDICATE: writer-method < method-body "writing" word-prop ;
+PREDICATE: writer-method < method "writing" word-prop ;
 
 : <slot-spec> ( -- slot-spec )
     slot-spec new
index 034d86b9c68c905ea28054fab2e460c2fe520719..bd703d3cb9247fc0af936bcd82c81e9bb6e9953a 100644 (file)
@@ -18,7 +18,7 @@ GENERIC: word-vocabulary ( word -- vocabulary )
 
 M: word word-vocabulary vocabulary>> ;
 
-M: method-body word-vocabulary "method-generic" word-prop word-vocabulary ;
+M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
 
 :: do-step ( errors summary-file details-file -- )
     errors