@xpqz I didn't notice any revised edition, only a question about P9. I have some test cases I'll try out on the array solution and then send you. Can you email me a link to the updated version?
@k1m190r really, it'd be better if ÷ were swapped too, as the thing to the right of it is usually constant (see (a+b)÷2 vs 2|a+b - no parentheses for the reversed version)
@k1m190r ÷ and - are the way they are for legacy (traditional mathematical notation) reasons. Functions in APL generally take the main data argument on the right and the parameter or specification on the left. So - and ÷ should really be reversed. Indeed, you'll often find -⍨ or ÷⍨. Since | was new, it could be the "proper" way.
@k1m190r I read | as remainder, not "modulus", which is ambiguous anyway.
@dzaima I agree with you that compress and reduce should be linear and is fairly easy to reason about it, but it kind of becomes interesting to think about the complexity of expand
The idea of big O notation is to give an asymptotic explanation of how the time complexity grows when the inputs change. My question was more of a "is this the complexity", and not so much "does this expression make sense"
it's HTML+CSS (and SVG happens to be part of HTML)
here we go https://dzaima.github.io/paste/#0zVjfk9o2EH6/v0Ilk5ljijjZBh/YdzeZ9qUvfe27ABnUE7bHFgd3DP97V7JsC/wjtCFJk0mwP61Wq29Xuys/5fJdsJe7/G0dxIm8D7IkkcMxvGIeCx4zjCN6TN5YFolkH7zxnC8EO10KrHieCvoeGGghkuVrGCWxxDn/YABvWMZluGF8vZGBw7bhpcoQ3iVfUoGp4Os4wGPHnbLt5UrjiGKxPjaE3S7hPXaOe76Sm2BM/G4htxRyumW8Smb22Ck0KYW69UxLEa9nMb8S6l7rsZSZ9AjNSqFOiXkl0UOQQ0qpPqGKa7@HIqciu0emInvWQ5JTsd23XMX3vIcmpyTc6ZQo6XZ6I8mZVWJ9ls9rqR7bXVKJdelKd0JgwSJ53NJszWOc6TM29uCQFXPpTiadM7V0OVWpuWbmIslWLDuWx7krtAQ31rvt49H@YndqDn1nWY5A@DLHLBIpk21AQm0lCQubtY1hmuRc8gTeFnkidpKFBQsklEkaEEtze6qyElOlKmOCSv7GQskO0iSaJYslyxq5ynHH08@hFT@9G8F7t…
@RikedyP For vector arguments, compress algorithms have a term that's linear in the argument length and one that's linear in the result length, and sometimes one that's linear in the number of times the left argument switches from 0 to 1 or 1 to 0. It tests the left argument to pick a good algorithm. All those terms are bounded by the length so it is O(n), but the exact timing can be complicated. PDepth1 will get slower with more parentheses both from the compress and the arithmetic after it.
Topic that is not covered in the Mastering Dyalog book (2009) is trains/ tacit programming. I'm reading aplwiki and Dyalog documentation on the topic, but my mental model is still a little blurry. Maybe need way way more time just writing and reading more code... Anyway any pointers from the pros who just grok the tacit lines will be much appreciated. I think it just takes time as with everything....
Also, if that's the kind of exercise that would work for you, you could check the tacit entries on apl cart (aplcart.info?q=tacit), randomly pick one, and try to understand how it works
Ok, maybe use the "quiz" functionality on APL Cart (aplcart.info/quiz) and use the "Explaining the purpose of a given function" section.