More cleanups for Method code organization.
authorBrian T. Rice <briantrice@gmail.com>
Mon, 8 Mar 2010 23:32:30 +0000 (15:32 -0800)
committerBrian T. Rice <briantrice@gmail.com>
Mon, 8 Mar 2010 23:32:30 +0000 (15:32 -0800)
src/core/method-query.slate
src/lib/devsupport.slate
src/mobius/primitive-method.slate

index a34fc4e..88272dd 100644 (file)
@@ -67,8 +67,7 @@ implement that selector."
 
 m@(Closure traits) new [m clone].
 m@(Closure traits) arity [m method arity].
-m@(Closure traits) acceptsAdditionalArguments
-[m method acceptsAdditionalArguments].
+m@(Closure traits) acceptsAdditionalArguments [m method acceptsAdditionalArguments].
 m@(Closure traits) allSelectorsSent [m method allSelectorsSent].
 m@(Closure traits) selector [m method selector].
 m@(Closure traits) optionalKeywords [m method optionalKeywords].
index 2fbdd98..752388b 100644 (file)
@@ -7,20 +7,21 @@
 
 "'' allRoles."
 
-
 x@(Root traits) allRoles
-[ |array writer |
-  array: ExtensibleArray new.
-  writer: array writer.
-  x allDelegates do: [|:delegate| delegate roleReader >> [|:r| r selector -> r rolePositions] >> writer].
-  array
+[
+  [| :result |
+   x allDelegates do:
+     [| :delegate |
+      delegate roleReader >> [| :r | r selector -> r rolePositions] >> result]
+  ] writingAs: ExtensibleArray
 ].
 
 d@(Debugger traits) printCurrentStack &limit: limit &stream: out &showLocation: showLocation
 [
-  d clone `>> [baseFramePointer: (d interpreter framePointerOf: #printCurrentStack).
-               buildFrames. 
-               printBacktrace &limit: limit &stream: out &showLocation: showLocation ]
+  d clone `>>
+    [baseFramePointer: (d interpreter framePointerOf: #printCurrentStack).
+     buildFrames. 
+     printBacktrace &limit: limit &stream: out &showLocation: showLocation ]
 ].
 
 x@(Root traits) methodsUsingMe
@@ -57,7 +58,7 @@ x@(Root traits) printMostCommonlyCalledMethods
 ].
 
 m@(CompiledMethod traits) breakOnEntry
-[ | regCount |
+[| regCount |
   regCount: m registerCount.
   m registerCount: regCount + 2.
   m method code: {VM SSACode loadEnvironment. regCount. 
index cc32236..4f80f19 100644 (file)
@@ -7,13 +7,11 @@ m@(PrimitiveMethod traits) applyTo: args
 
 m@(PrimitiveMethod traits) method [m].
 
-m@(PrimitiveMethod traits) acceptsAdditionalArguments
+m@(PrimitiveMethod traits) acceptsAdditionalArguments [False].
 "Primitives have no *rest parameters."
-[False].
 
-m@(PrimitiveMethod traits) optionalKeywords
+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
@@ -35,17 +33,14 @@ m@(PrimitiveMethod traits) definitionLocation
   'primitive:' ; m index printString
 ].
 
-m@(PrimitiveMethod traits) allSelectorsSent
+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: _
+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
+m@(PrimitiveMethod traits) allSelectorsSentImplicitly [#()].
 "Answer an empty Collection since PrimitiveMethods obviously don't call any
 other methods, otherwise they wouldn't be primitive!"
-[{}].