Skip to main content

reduce

reduce(
@llll ## required
@function ## required
) -> llll/null

Applies cumulatively a binary function to all the elements in an llll.


Arguments

  • @llll [llll] (required)
  • @function [function] (required)

Output

Reduced value. [llll/null]

warning

reduce is a built-in function in the bell programming language and is not unique or exclusive to bellplay~. As such, reduce will return null without raising an error if required arguments are not provided.


Usage

reduce(1...3, #+) ## 6
reduce(1...3, #-) ## -4
reduce(1...3, #*) ## 6
reduce(1...3, #/) ## 1/6