Moved more protocol into primitive-method.slate.
authorBrian T. Rice <briantrice@gmail.com>
Mon, 8 Mar 2010 22:54:18 +0000 (14:54 -0800)
committerBrian T. Rice <briantrice@gmail.com>
Mon, 8 Mar 2010 22:54:18 +0000 (14:54 -0800)
src/core/method-query.slate
src/mobius/primitive-method.slate

index a7a2cfc..a34fc4e 100644 (file)
@@ -1,25 +1,12 @@
-m@(PrimitiveMethod traits) arity
-"Use the fact that all PrimitiveMethods have selectors to determine their
-arity from the name."
-[m selector arity].
-
 m@(CompiledMethod traits) arity
 "Uses the slot which declares the number of input variables to answer the
 method's arity."
 [m inputVariables].
 
-m@(PrimitiveMethod traits) acceptsAdditionalArguments
-"Primitives have no *rest parameters."
-[False].
-
 m@(CompiledMethod traits) acceptsAdditionalArguments
 "Answers whether the method has a *rest paramter."
 [m restVariable].
 
-m@(PrimitiveMethod traits) optionalKeywords
-"Primitives may take optionals, but we cannot currently communicate that."
-[{}].
-
 m@(CompiledMethod traits) allSelectorsSent
 "Answer a collection of all the Symbols used as direct message-sends in the
 method's body. This excludes local accessors which count as loads and stores."
@@ -78,21 +65,6 @@ implement that selector."
   ] writingAs: Set
 ].
 
-m@(PrimitiveMethod traits) allSelectorsSent
-"Answer an empty Collection since PrimitiveMethods obviously don't call any
-other methods, otherwise they wouldn't be primitive!"
-[{}].
-
-m@(PrimitiveMethod traits) allSelectorsSentToArg: _
-"Answer an empty Collection since PrimitiveMethods obviously don't call any
-other methods, otherwise they wouldn't be primitive!"
-[{}].
-
-m@(PrimitiveMethod traits) allSelectorsSentImplicitly
-"Answer an empty Collection since PrimitiveMethods obviously don't call any
-other methods, otherwise they wouldn't be primitive!"
-[{}].
-
 m@(Closure traits) new [m clone].
 m@(Closure traits) arity [m method arity].
 m@(Closure traits) acceptsAdditionalArguments
index d9562b1..cc32236 100644 (file)
@@ -7,6 +7,19 @@ m@(PrimitiveMethod traits) applyTo: args
 
 m@(PrimitiveMethod traits) method [m].
 
+m@(PrimitiveMethod traits) acceptsAdditionalArguments
+"Primitives have no *rest parameters."
+[False].
+
+m@(PrimitiveMethod traits) optionalKeywords
+"Primitives may take optionals, but we cannot currently communicate that."
+[{}].
+
+m@(PrimitiveMethod traits) arity
+"Use the fact that all PrimitiveMethods have selectors to determine their
+arity from the name."
+[m selector arity].
+
 m@(PrimitiveMethod traits) literals [#()].
 m@(PrimitiveMethod traits) selectors [#()].
 m@(PrimitiveMethod traits) code [Nil].
@@ -21,3 +34,18 @@ m@(PrimitiveMethod traits) definitionLocation
 [
   'primitive:' ; m index printString
 ].
+
+m@(PrimitiveMethod traits) allSelectorsSent
+"Answer an empty Collection since PrimitiveMethods obviously don't call any
+other methods, otherwise they wouldn't be primitive!"
+[{}].
+
+m@(PrimitiveMethod traits) allSelectorsSentToArg: _
+"Answer an empty Collection since PrimitiveMethods obviously don't call any
+other methods, otherwise they wouldn't be primitive!"
+[{}].
+
+m@(PrimitiveMethod traits) allSelectorsSentImplicitly
+"Answer an empty Collection since PrimitiveMethods obviously don't call any
+other methods, otherwise they wouldn't be primitive!"
+[{}].