danielsz/system

pass a parameter to the system function

nha opened this issue · 2 comments

nha commented

My component-making function takes a parameter like so:

(defn new-system [profile] )

And I am trying to create a new system:
(system.boot/system :sys (partial make-system profile) :auto true)
This fails with: java.lang.Exception: sys argument expects a Var, eg. #'system-dev

I tried working around with:

  • (defn make-system [] (partial 'new-system profile))
  • with-local-vars

Is there a way to pass a parameter to the function creating the component?

Note: I would like to use system with boot in case it matters

There is no way to pass a parameter to the function creating the component. This is by design. We pass configuration profiles via boot.environ. Please refer to the examples to see how it's done.

If you want to make the case for an alternate configuration mechanism, please feel free to create a new issue with an outline of that design.

Closing for now.