arrayutils: splitModulo and concatAModulo are made total#1194
arrayutils: splitModulo and concatAModulo are made total#1194dmitry-vlasov wants to merge 3 commits into
Conversation
shkel
left a comment
There was a problem hiding this comment.
how many times are these functions used? (splitModulo and concatAModulo).
if no one uses them (1-2 times), then they should not be in the library at all. Why they are needed and what they do is also unclear.
| a[i % m][i / m] | ||
| ); | ||
| j = ref 0; | ||
| i = ref for(0, \k -> (k < m) && (^j >= length(a[k])), \k -> k + 1); |
| j = ref 0; | ||
| i = ref for(0, \k -> (k < m) && (^j >= length(a[k])), \k -> k + 1); | ||
| generate(0, len, \__ -> { | ||
| x = a[^i][^j]; |
There was a problem hiding this comment.
unsafe retrieval of element by index
There was a problem hiding this comment.
Here retrieval is safe. It may be proved.
| i = ref for(0, \k -> (k < m) && (^j >= length(a[k])), \k -> k + 1); | ||
| generate(0, len, \__ -> { | ||
| x = a[^i][^j]; | ||
| i := for(^i + 1, \k -> (k < m) && (^j >= length(a[k])), \k -> k + 1); |
There was a problem hiding this comment.
for is not a functional style. please, don't use for
There was a problem hiding this comment.
for function itself is completely functional (see its definition). What is not "functional" here is usage of references. I use references to get efficiency and clear small implementation of a function.
I used these functions. What do these functions - I already explained to you thoroughfully. The concise explanation is given in comments. The general character of these functions mean that their place in the general library. |
used or use ? I suggest removing these functions |
I cite your message: "люди ее используют так, как описано в комментарии. я не вижу проблемы чтобы убрать креш и соединить массивы. (People use it as it is described in a comment. I don't see a problem in fixing a crash and joining arrays)". |
i do NOT use it. i found 2 uses of concatAModulo , and 0 of splitModulo |
|
No description provided.