« first day (1998 days earlier)      last day (659 days later) » 

10:40 AM
How to count matching symbols in two words? If the words are same length, then it's trivial: 'APL'+.='SPL'
Maiden attempt:
∇N←A IS B
N←⌊/≢¨A B
N←(N↑A)+.=N↑B∇
Another approach:
'APL'{+/∊((⍳≢⍺)∘.=⍳≢⍵)×⍺∘.=⍵}'SPLENDID'
However, I don't like both of them.
 
10:52 AM
@VadimTukaev You could do the somewhat hideous
      (+.=)/↓↑'APL' 'SPLENDID'

2
Won't work if the longer string contains spaces.
 
11:11 AM
Thanks, I like it! Although I would write a little clearer for me: +/=⌿↑'APL' 'SPLENDID'
 
11:48 AM
I wish it were possible to not hard-code the 3 in 'APL'(+.=⍥(3∘↑))'SPLENDID'
+.=/⌊⍥≢↑¨,⍥⊂ ?
 
@rabbitgrowth Nice.
 
12:01 PM
Or this? ⎕←'APL'(+⌿⊣=≢⍤⊣↑⊢)'SPLENDID'
 
@doug 2
 
Equivalently ⎕←'APL'(⊣+.=≢⍤⊣↑⊢)'SPLENDID'
 
@doug 2
 
Oh, but this presumes the one on the left is shorter. @rabbitgrowth’s is better.
 
12:32 PM
This too? ⎕←'APL'((⌊⍥≢↑⊣)+.=⌊⍥≢↑⊢)'SPLENDID'
 
@doug 2
 
I tried to avoid the each but once you make it an over, it’s monadic and you need both arguments for the minimum.
 
12:59 PM
+/1 1⍉∘.=
 
1:11 PM
Wonderful! I read about it in Gilman's book, but theory without practice tends to be forgotten.
 
 
8 hours later…
8:47 PM
@rabbitgrowth Awesome!
 
 
2 hours later…
10:39 PM
@doug {⍺+.=⍥((⍺⌊⍥≢⍵)∘↑)⍵} avoids the double computation.
 
 
1 hour later…
11:45 PM
function composition wiki page updated? Looks very cpmplete now. Thanks
 

« first day (1998 days earlier)      last day (659 days later) »