By the way, I was talking to a friend about APL the other day and she asked me a question that made me realize something: I've no idea what APL is used for commercially speaking. What kinds of applications people usually code in APL?
@Adám if I'm indexing something with a ⌷, can I get multiple indexes at a time? 1 2⌷vec doesn't work (obviously because it's not a matrix); I think I'll have to mix some ⍨s and ¨s. I tried ⌷vec⍨¨(1 2) but it also didn't work.
@J.Sallé Yes, unfortunately, until further notice. However, if you can make all the the tests and have a single "then" and a single "else", you can do {guard1∧guard2∧…:then ⋄ else}. If you have an entire binary tree, you may be able to select the result using 2⊥ as in None One Two OneAndTwo Three[⎕IO+2⊥Guard3 Guard2 Guard1]
@J.Sallé Generally, if I have a lot of decisions in my algorithm, I go with a tradfn to get proper structured programming.
@Adám I'll agree that there is inconsistency, but, as long as the default is to not use the short-circuiting (i.e. & is quicker to type than &&), those who need it, would rather remember arbitrary rules rather than do obscure & longer things.
This is more of a meta question, I guess, but anyway: Can I post a solution to a challenge with a shorter yet less optimized code, and post a more optimized code in TIO? (I'd explain it on the post body, naturally.)
@Ven It wouldn't solve that. Maybe not high priority for the functional programming focused dfns. Tradfns do have short-circuiting :AndIf and :OrIf etc.
@J.Sallé What do you need? First I thought of using DateToIDN to check for valid dates, but then I realised I might as well generate the entire range using IDNToDate.