« first day (2913 days earlier)      last day (35 days later) » 

05:39
Unfortunately dyadic ⊣@(0=⊢) gives length error
 
4 hours later…
09:42
Maybe (x(0∘=⍛/)y)@(0∘=)x or (m/x)←(m←0=x)/y
Think either way you'd need to mask out the locations to prevent a Length Error
in both arrays that is - to find the locations and then the values
 
3 hours later…
12:25
@RubenVerg the best way is the more easy to think, one loop
at last for me... if in x[i] there is 0, then x[i]=y[i]
12:43
For(i=0;i<n;++i)if(a[i]==0)a[i]=b[i] this as it be C
13:10
Pheraps im ot...
 
1 hour later…
14:30
@Rosario that's sort of a translation of my second expression - select where the zeros are in x (m/x)and then replace those with the corresponding y values (0=x)/y
APL is about trying to apply operations to the entire dataset rather than single elements
15:01
Thank you Adám, your answer was incredibly thorough and gave me a lot to think about, as I think I'll be re reading it for the next few days :)
In the meantime, two things jump out to me:
1) I can't figure out what `,∘,` does. I played around with it some, and replacing it with `,` in the code you shared seems to not break anything: is it maybe a generalization for higher rank arrays? In general, composing a function with itself looks a bit unusual to me. Could `⍤` be used instead of `∘`? Do you think it that would be more clear?
(I don't know why my snippets did not get inlined)
 
3 hours later…
17:58
x[⍸x=0]←y[⍸x=0]
 
4 hours later…
21:36
@RubenVerg I think so, but @Rosario's last solution is excellent too, though better written (m/x)←y/⍨m←0=x
22:06
@Jack regarding f∘g vs f⍤g is more to better show in the dyadic case which of f or g sees both arguments - so preprocess with or post process
tacit.help might make this clearer
,∘, is {⍺,(,⍵)} - if you don't need the ravel then can indeed just catenate

« first day (2913 days earlier)      last day (35 days later) »