<FromGitter>
<Blacksmoke16> new up some output array, using some heuristic to allow it to allocate once, use the block version of `each_permutation` to yield each permutation and push it to the allocated array
<FromGitter>
<Blacksmoke16> most optimal that i could think of off the top of my head*
<hholst>
what would be more useful, to return a list or to yield?
<hholst>
in python you would typically yield and the function would return an iterator, and then cast that to a list if need be
<hholst>
is it more useful to have a block consuming function than to return a list of object like I did here?
<hholst>
of the size stuff heuristic would need to move outside as well
<hholst>
binom(3,1) + binom(3,2) would be the size btw :)
<hholst>
I think... no wait. its permutations not combinations.. ok probably more complex
<hholst>
I am rewriting a python microservice that computes sub sums of numbers (amounts in an invoice). mostly for fun but also because the python code is kinda slow
<FromGitter>
<threez> Hi I created a shard for PDF writing. I would like to get feedback as this is my first bigger crystal project. Maybe somehow here has the time for a review? https://github.com/threez/hpdf.cr
hholst has quit [Quit: Client closed]
<SamantazFox>
threez: I haven't dug much into the functionality, but I can say that the code is very clean! I particularly appreciate the comments :)
ngp has joined #crystal-lang
<FromGitter>
<Blacksmoke16> could consider using enums for some stuff instead of modules with constants
<FromGitter>
<Blacksmoke16> would need to use another method to return the string representation tho, if you need those specific values