A named function but also with parameters
# announcements
f
A named function but also with parameters
s
Arrow and other functional libraries have partial application tools, but you can always just write a lambda that wraps your function call
f
hmm yeah okay, thanks!
g
you probably know this, but if n and k are always/often the same, you could just give them default values. if you don't mind reordering the param list, that is.
Copy code
fun nthBits(index: Int, n: Int = 123, k: Int = 456): IntArray
f
Yeah they are the same but different for every call, when using the function to calculate stuff those stay the same in the loop but the index changes.
So I cant hard code them