-
Notifications
You must be signed in to change notification settings - Fork 297
[sketch] Prevent typos in option tables #797
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
Conversation
By analyzing the blame information on this pull request, we identified @lukego, @altexy and @javierguerragiraldez to be potential reviewers |
It is too much machinery, it's just the least bad option in these contexts. ;-) |
Hehe :) I admit, I really like common lisp's keyword arguments :) |
I would prefer this to be in Cc @lukego |
Great! I would really love to have this. I definitely have that uneasy feeling when using table parameters that are not validated for typos etc. Commonly do make mistakes on parameters to @eugeneia Good question. To me |
@lukego Completely agree that |
I would like to have this, but this PR seems forgotten. I would offer to take over integrating this, given there is demand. |
I agree; pinging @wingo . |
…config # Conflicts: # src/apps/rate_limiter/rate_limiter.lua
Merge upstream v2017.04 into lwaftr
Oftentimes we pass around tables of options. Some of those options are required, some are optional. Thing is, it becomes hard to add required options over time, as old code might not detect that it needs to change; it's also hard to let old code know when options go away; and most importantly it's easy to make typos. It's also a bit of irritating effort to provide for optional values which default to false; the idiom
conf.foo = conf.foo or bar
is just too easy to type.In the lwaftr and in pflua we use helpers to parse options that solve all these problems. Maybe they're good for snabb itself? Feedback welcome @lukego @eugeneia :)
I note that @kbara once thought this sort of thing was too much machinery, then it caught a nice bug and she became a believer :)