Fork me on GitHub
#specter
<
2017-05-03
>
mac13:05:24

I am faced with a design dilemma. I have data structure consisting of deeply nested records which reflect the domain I am working in. Querying this is very straight fwd using specter. But some of these records contain "behaviour" (ie. anonymous functions as values) in the form of validation functions, transformation functions (for how to transform themselves or other records in the structure), dispatch functions(that decides when to dispatch certain messages), conditions etc. I am debating (with myself) two different approaches: Either use multimethods to walk/query the datastructure/trigger behaviour OR use specter for the same task. My primary (perhaps very unfounded) concern with specter is that my structure contains "behaviour". My concern with the multimethod approach is that it will be messy and hard to maintain. Hope my question is even remotely clear, otherwise happy to clarify and context.

nathanmarz13:05:16

@mac I think using specter is fine for that task

nathanmarz13:05:44

you probably want to use traverse with reduce to trigger the nested functions

mac14:05:57

Thanks, had not noticed traverse, looks very useful.