You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a pretty common case that I want optional config keys because the function that will eventually take in that config has its own fallbacks. For example, with langhor (library for RabbitMQ), the connect function accepts a map of connection parameters, e.g. :host, :port, :username etc., all of which are optional and have defaults if they're not provided. So it makes sense for me to model my config after the map the connect function accepts and exploit the built-in fallbacks. Furthermore, when I do want to set a value, I want to do it with environment variables. However, there doesn't seem to be a way to tell this library to optionally include a key based on whether or not an environment variable expansion is successful. The only way to avoid an exception is to provide a non-nil default, but that would require me to essentially duplicate the defaults that are already handled by langhor. Would it be possible to have some kind of reader conditional for optional configuration within a profile (perhaps where nil as a value drops the key)?
The text was updated successfully, but these errors were encountered:
It's a pretty common case that I want optional config keys because the function that will eventually take in that config has its own fallbacks. For example, with langhor (library for RabbitMQ), the
connect
function accepts a map of connection parameters, e.g.:host
,:port
,:username
etc., all of which are optional and have defaults if they're not provided. So it makes sense for me to model my config after the map theconnect
function accepts and exploit the built-in fallbacks. Furthermore, when I do want to set a value, I want to do it with environment variables. However, there doesn't seem to be a way to tell this library to optionally include a key based on whether or not an environment variable expansion is successful. The only way to avoid an exception is to provide a non-nil default, but that would require me to essentially duplicate the defaults that are already handled by langhor. Would it be possible to have some kind of reader conditional for optional configuration within a profile (perhaps wherenil
as a value drops the key)?The text was updated successfully, but these errors were encountered: