Skip to main content

classify

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

Arranges elements into classes. When @function is null, it uses the default comparison function.


Arguments

  • @llll [llll] (required)
  • @function [function/null] (default: null)

Output

Classified @llll [llll/null]

warning

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


Usage

classify(1 2 1 3 2 1); ## [ 1 1 1 ] [ 2 2 ] [ 3 ]
classify('a' 'b' 'c' 'a' 'c') ## [ a a ] [ b ] [ c c ]