« first day (2495 days earlier)      last day (320 days later) » 

2:58 AM
@Jack What about +⍥(0⌈⊢)? Though I'm not sure about your spec. Shouldn't ¯1 1 1 f 0 1 ¯2 return 0 2 0 since the last element of the second argument is negative and we only add if both args to + are non-negative?
Also, welcome to APL! Your futzing looks like exactly the kind of explorations I did at the beginning.
3:32 AM
@B.Wilson That's a solid solution, but the original problem statement said it should add for all "non zero" element pairs, not "non negative".
@Jack I think your "abomination" is definitely excessive but it at least looks pretty. You're on the right track with trains, especially nesting trains, but you can get rid of a parenthesis pair at least:
go from f←+×((××)×(××))
to f←+×(××)×(××)
and they should be the same. However, you were on the right track with the dfn. You can actually put in your own argument into the left "tine" instead of another operation.
This means we can rewrite your dfn as f←+×(0≠×), but the parenthesis is redundant, so you can write your function as f←+×0≠×
 
9 hours later…
12:39 PM
starting to think I might have set the bar too high for myself in implementing tinyapl
interpreting turns out to be really hard to do properly
especially in Haskell, which doesn't lend itself to implementing mutation-happens-whenever apl code
 
2 hours later…
Ven
Ven
2:30 PM
language of implementation really shouldn't matter much
 
3 hours later…
5:04 PM
once you get into three layers of monad transformers just to get quad assign to work, it kinda does :)
though the problem is definitely more in my lack of skills, I definitely bit off more than I could chew
@RubenVerg That's literally what I did in the next msg; H.

« first day (2495 days earlier)      last day (320 days later) »