CachedCalls

CachedCalls._deconstructMethod
_deconstruct(ex)

Deconstruct expression ex to a tuple (function name, arguments, kwarg names, kwarg values)

CachedCalls._extract_kwargsMethod
_extract_kwargs(callargs::AbstractArray{Any}; keep_args=false)

Extract a tuple of (:kwarg_name, value) from :call expression args.

CachedCalls.cachedcalls_dirMethod
cachedcalls_dir(p::Union{String, PosixPath})

Sets the path to where the cached files are stored to p.

CachedCalls.@cached_callMacro
@cached_call f(args; kwargs)

Caches the result of f(args; kwargs) to disk and returns the result. The next time f(args; kwargs) is called with the same values of args and kwargs the cached result is returned and f is not called again. Splatting is not yet supported.

Restrictions on f apply: it must not mutate its arguments or access/mutate globals. These assumptions will not be checked and if violated could mean that an incorrect result is returned.

Functions are differentiated by name only, meaning that changing the definition and rerunning @cached_call will return the wrong result.

CachedCalls.@hash_callMacro
@hash_call f(args; kwargs)

Computes the hash of the function call f(args; kwargs) by hashing f, the values of args, the names of kwargs, and the values of kwargs.

Different order of kwargs will hash differently. Setting the default values of kwargs explicitly will hash differently than using the defaults implicitly. Splatting is not yet supported.