Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: reset-logger-stream , Previous: repeat-format , Up: R , Home: Overview

Clamps Dictionary

repeated

Function

(repeated n fn)

Return a function which applies a given function fn n times onto itself. fn must be a function of at least one argument which returns one argument. The return value of the function replaces the first argument in the next recursive call, leaving all other arguments as they were.

Arguments

n Integer number of repetitions.
fn Function to be applied to itself.

Examples

(funcall (repeated 4 (lambda (x) (* x 2))) 1)  ; => 16

(funcall (repeated 4 (lambda (x) (* x 2))) 3) ; => 48

See also

Author: Orm Finnendahl

Created: 2025-02-18 Di 12:58

Validate