methods() Usage Parameters 1. multimethod 2. methodType Return value Version History

methods()

import { methods } from "@fed1/jsos";

A JSFunction that produces a string documenting the available methods of a multimethod.

Usage

methods(multimethod)
methods(multimethod, methodType)

Parameters

# Parameter Required? Type Default
1 multimethod yes TGeneric
2 methodType no TEnumItem MT_PRIMARY

1. multimethod

The multimethod whose methods shall be documented.

2. methodType

An enum item specifying the type of methods to document (primary, around, before, after).

Use the METHOD_TYPE constants here.

If no methodType is specified, the primary methods are documented.

Return value

A JSString that documents the methods of a multimethod of the specified type (if no type is provided, the primary methods).

The returned string looks like this for methods(explain):

This multimethod has these 4 'primary' methods:

 [1] explain(TAny)                     at .../std/introspection.js:15:1
 [2] explain(TType)                    at .../std/introspection.js:32:1
 [3] explain(TType<t => t === TType>)  at .../std/introspection.js:33:1
 [4] explain(TGeneric)                 at .../std/introspection.js:156:1

Version History

Feature Since version
methods() 1.0