Closed dfellis closed 1 month ago
repeat
can't really be done, because the return type is based on the value passed into function at runtime. I can have the multiple in the generic type list and do it that way without a second arg, but then type inference doesn't work anymore (no such thing as partial type inference, and I'm not sure if I want to have it, because then you also need to have some ability to guess which type the provided value belongs to).
So I'm thinking about what exactly to do here, and maybe, for now, repeat
converts the buffer into an array.
Forgot these in the first set of issues I created for myself. The Buffer type also needs many similar methods as the Array type.
The functions desired for a first v0.2.0 are:
map
reduce
find
join
every
store
concat
repeat
len
has
You'll note that
filter
anddelete
are missing from this list. That's because they would produce a new buffer of an unknowable length at compile time (technicallydelete
could work, but I don't know if that should be encouraged, since it basically requires allocating a new buffer and copying the other values over, which is problematic for very large buffers).