Product Site

5.1.3.14. scope

Returns the defining class scope for a method. Returns .nil for any method not defined by a class scope.

Example 5.29. Method class — scope method
scopes = .Stem~new
scopes[] = 0
loop with item method over .List~methods
  scopes[method~scope] += 1                 -- possible output:
end                                         -- 27 methods from The List class
loop scope over scopes                      -- 19 methods from The Collection class
  say scopes[scope] "methods from" scope    -- 20 methods from The OrderedCollection class
end                                         -- 31 methods from The Object class

.Method~new("any", "nop")~scope             -- .nil

.methods["FLOAT"]~scope                     -- .nil
::method float