apply
apply(
@function ## required
@argsbyposition ## required
@argsbyname ## required
) -> llll/null
Calls another function by passing it individual parameters expressed as two lllls, one for arguments passed by position, the other for arguments passed by name.
Arguments
@function[function] (required)@argsbyposition[llll] (required)@argsbyname[llll] (required)
Output
output of input @function [llll/null]
warning
apply is a built-in function in the bell programming language and is not unique or exclusive to bellplay~. As such, apply will return null without raising an error if required arguments are not provided.
Usage
$fun = ($name -> print('Hello ' + $name + '!'));
apply($fun @argsbyname ['name' 'Bob']); ## Hello Bob!
apply($fun @argsbyposition 'Alice') ## Hello Alice!