@r47onfire/backolon - v0.0.0
    Preparing search index...

    Interface CustomApplicator

    Defines what happens when an object of a particular non-builtin type is called as the functor in an apply expression. See NativeModule.defcall for details.

    interface CustomApplicator {
        call(
            task: any,
            functor: Thing,
            argv: Thing<string | ThingType>[],
            callsite: Thing,
            env: Thing<env> | Thing<nil>,
            name?: string,
            significant?: boolean,
        ): void;
        params(functor: Thing): ParamDescriptor[];
    }
    Index

    Methods

    Methods

    • Implements what happens when a functor of the given type is called.

      The applicator will be called with the functor, arguments, and callsite information, and should perform the application (e.g. by evaluating the functor with the given arguments in some environment) and eventually produce a result by calling task.out(result).

      Parameters

      • task: any

        The current task, which can be used to evaluate code and return results.

      • functor: Thing

        The thing that was called.

      • argv: Thing<string | ThingType>[]

        The arguments to the call.

      • callsite: Thing

        The location of the apply form in the source code, used for error reporting.

      • env: Thing<env> | Thing<nil>

        The current environment that the call is being made in, which can be used to look up variables and patterns.

      • Optionalname: string

        The resolved name of the functor being called (for debugging purposes), or undefined if the functor isn't named.

      • Optionalsignificant: boolean

        True if the runtime has determined that this call will show a stack frame in a traceback should an error occur.

      Returns void

    • Return the parameter descriptors for the given functor, which will be used for type checking and lazy evaluation of arguments when this applicator is called. The functor will always be a Thing of the type that this applicator was registered for.

      Parameters

      Returns ParamDescriptor[]