Package: decorators 0.3.0

Harel Lustiger

decorators: Extend the Behaviour of a Function without Explicitly Modifying it

A decorator is a function that receives a function, extends its behaviour, and returned the altered function. Any caller that uses the decorated function uses the same interface as it were the original, undecorated function. Decorators serve two primary uses: (1) Enhancing the response of a function as it sends data to a second component; (2) Supporting multiple optional behaviours. An example of the first use is a timer decorator that runs a function, outputs its execution time on the console, and returns the original function's result. An example of the second use is input type validation decorator that during running time tests whether the caller has passed input arguments of a particular class. Decorators can reduce execution time, say by memoization, or reduce bugs by adding defensive programming routines.

Authors:Harel Lustiger [aut, cre], Tidylab [cph, fnd]

decorators_0.3.0.tar.gz
decorators_0.3.0.zip(r-4.5)decorators_0.3.0.zip(r-4.4)decorators_0.3.0.zip(r-4.3)
decorators_0.3.0.tgz(r-4.5-any)decorators_0.3.0.tgz(r-4.4-any)decorators_0.3.0.tgz(r-4.3-any)
decorators_0.3.0.tar.gz(r-4.5-noble)decorators_0.3.0.tar.gz(r-4.4-noble)
decorators_0.3.0.tgz(r-4.4-emscripten)decorators_0.3.0.tgz(r-4.3-emscripten)
decorators.pdf |decorators.html
decorators/json (API)
NEWS

# Install 'decorators' in R:
install.packages('decorators', repos = c('https://tidylab.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/tidylab/decorators/issues

Pkgdown site:https://tidylab.github.io

On CRAN:

Conda:

decoratorsdesign-patterns

3.78 score 12 stars 1 scripts 192 downloads 4 exports 7 dependencies

Last updated 3 years agofrom:c74e1ad648. Checks:1 OK, 8 WARNING. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKMar 12 2025
R-4.5-winWARNINGMar 12 2025
R-4.5-macWARNINGMar 12 2025
R-4.5-linuxWARNINGMar 12 2025
R-4.4-winWARNINGMar 12 2025
R-4.4-macWARNINGMar 12 2025
R-4.4-linuxWARNINGMar 12 2025
R-4.3-winWARNINGMar 12 2025
R-4.3-macWARNINGMar 12 2025

Exports:%>%%||%time_itvalidate_arguments

Dependencies:cligluelifecyclemagrittrpurrrrlangvctrs