-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor options #62
Comments
Now I'm second-guessing (third-guessing, actually) myself: Maybe we DO want to make all use of this library via the application and the state management of the gen_server? It would certainly simplify things by unifying the approach to options across all modules with no exceptions ... |
So the reason
|
If all the options and related data go into state, it would be nice to have easy access to each value (a la memcache), so I was thinking about refactoring these to be values stored as map keys. A quick googling turned up this gem: Refactoring Erlang programs with regards to energy efficiency. Sold. I'll be re-editing the ticket description to take this into account. |
Right now, options and their defaults are defined in the include file. These are accessed via the
loise-opts
module. Additionally, various modules may set up their own options, usually defined at the top of the module in anoptions
function.We need to make sure that the library is still usable for those not wishing to use the gen_server and just want access to the raw functions. It makes sense for the various modules (png, egd, ascii, perlin, simplex, etc.) to continue using
loise-opts
and the various defaults.With that being said, now that we have state management (see #64), we can:
include/options.lfe
and into their respective modules of interest and convert proplists to mapsinclude/options.lfe
to a module, moving it to something likesrc/loise-defaults.lfe
src/loise-defaults.lfe
src/loise-defaults.lfe
-- avoid nested maps as much as possibleloise-opts
to get the state data and extract value for keyDepends upon
The text was updated successfully, but these errors were encountered: