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
{{ message }}
This repository was archived by the owner on Sep 22, 2024. It is now read-only.
As much as I like the way of calling the streams with (limit: l, fraction_digits_limit: fl), it breaks most of the defdelegate macros as they don't support (AFAIK) passing keyword lists. So I think this is worthy of a discussion of how we want to shape the API. Now that we have so many generators, the orangeade.ex file in which all the defdelegate calls were stored is now a tiny bit messy. So wat do wat do man.
I see three ways of fixing this (I will be using the function from above as the example):
We add a stream(limit, fraction_digits_limit) function to the file so that there are two ways of calling it, allowing us to defdelegate from the orangeade.ex file.
We add a float(limit, fraction_digits_limit) function that works in the same way as the stream example above, but this allows us to minimize the noise in orangeade.ex file. (This will get rid of the , as: :stream part.
We leave the code as is and forget about delegation, meaning that the API is more convoluted (Orangeade.float(limit, fraction_digits_limit) vs Orangeade.Generator.Float.stream(limit: l, fraction_digits_limit: fl), but this saves us the trouble of refactoring almost all the files to support the previous two APIs.
Personally I am all for the 2. way even though it requires a bit more work.