-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Milestone
Description
Motivation #115 (comment)
Use a new function to lookup values from resource definitions to
- ensure uniform invocation of functions that are specified in a resource definition. The signature of the functions must be f :: context-map -> any
- drop premature conversion of the resource map values to functions. This prevents inspection of the resource definition at runtime because values have be replaced by cryptic anonymous functions
Provposed implementation:
(defn lookup-resource [ctx key]
(let [v (get-in ctx [:resource key])]
(if (fn? v) (v ctx) v)I'm not sure about the name and whether (defn lookup-resource [resource key context]) would be more explicit. However, the later variant is redundant because the resource is always available in the context.
Metadata
Metadata
Assignees
Labels
No labels