Class Closure

Summary

A Closure object encapsulates a function and partial argument list. The missing arguments can be filled in at the point of call using the call(args) method. This is an alternative to the closure procedure.j

Superclasses:
Object

Package:
lang
File:
fcn_util.icn
Methods:
call, doInvocation

Methods inherited from Object:
Type, className, clone, equals, fieldNames, genMethods, getField, get_class, get_class_name, get_id, hasField, hasMethod, hash_code, instanceOf, invoke, is_instance, setField, to_string

Fields:
fcn

Source code.

Details
Constructor

Closure(f, args)

Parameters:
f
function that closure is built around
args
remaining parameters are arguments supplied as part of closure

Given a function and a list of arguments, produces an Closure object. Any argument whose value is Arg is filled at the point of invocation using arguments to the calls() method.

Methods:

call(args)

Generates:
results from invoking Closure with supplied arguments

Call this Closure object with args as the missing parameters. Parameters that are still missing are set to &null. Extra arguments are appended to the parameter list.


doInvocation(flist, args)

Internal use only. Merges the argument list into the Closure object and then invokes it. Missing arguments are mapped to &null.


Fields:
fcn


This page produced by UniDoc on 2021/04/15 @ 23:59:53.