fukamachi / envy

Configuration switcher by an environment variable inspired by Config::ENV.
BSD 2-Clause "Simplified" License
57 stars 4 forks source link

Added dynamic evaluated configuration #4

Closed windymelt closed 5 years ago

windymelt commented 5 years ago

I added a sugar-syntax that calls function when configuration value is function.

For example:

(defconfig :common
  `(:REDIS-HOST ,(lambda () (uiop:getenv "REDIS-HOST"))))

In current implementation, configuration value is determinate because configuration is eval-ed at compilation timing. However compilation timing and execution timing is not always same.

fukamachi commented 5 years ago

Thanks!