A method is a stateless procedure which receives some values, does some work using those value, and returns one or more values. New methods are typically defined either by compiling an Acorn source program or from loading a shared library containing types defined using the C API. Use of a method most often happens within the context of using any value's active properties, although it is possible to invoke them directly as a function (having no defined self) using '()'.

Class Properties (see Type)

(pgmsrc, baseurl) -> method

Compile the program source (a Text value) and return the compiled method. A single program may include definitions of other methods which are also compiled each as its own method instance which is stored appropriately.

baseurl is a symbol indicating the URL where the program source came from. This provides needed context to resolve any relative url's specified within the program. baseurl may be null.

-> mixin

The mixin whose properties are used by instances of Method.

Instance Properties

[...] -> values

Perform the method with a self of null, passing all specified parameters to it. All return values from the method are returned.

-> integer

Return the number of fixed parameters expected by the method (not including self).


Attempt to resolve any externs (static resources). Return null if all resolved, or else a count of the number of externs still unresolved (typically due to resources not finished loading).

-> bool

True if method accepts an arbitrary number of additional arguments (after the fixed set).