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.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'))

Peer review:

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

On CRAN:

decoratorsdesign-patterns

4 exports 12 stars 1.59 score 7 dependencies 1 scripts 202 downloads

Last updated 2 years agofrom:c74e1ad648. Checks:OK: 1 WARNING: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 13 2024
R-4.5-winWARNINGSep 13 2024
R-4.5-linuxWARNINGSep 13 2024
R-4.4-winWARNINGSep 13 2024
R-4.4-macWARNINGSep 13 2024
R-4.3-winWARNINGSep 13 2024
R-4.3-macWARNINGSep 13 2024

Exports:%>%%||%time_itvalidate_arguments

Dependencies:cligluelifecyclemagrittrpurrrrlangvctrs