« first day (2873 days earlier)      last day (41 days later) » 

06:25
@Adám Here's an interesting approach to system-wide APL input: github.com/secwang/espanso-apl-keyboard
 
3 hours later…
09:38
Thanks, Paul. Enclosing was what I needed. I still need to build up my intuition for strings not being strings :)
10:29
'foo' 'bar' 'foo' 'baz'∊⊂'foo'
@JohannesHoff Careful about the semantics of . It looks for places where the entire argument on the left occurs as a subarray within the right argument.
My example above gets what (I believe) you want, but at first blush it does seem to be using backwards. The key is that returns true/false for every item on the left, which gives us what we want when the right argument is a single item.
But since strings in APL are character vectors and not single items, we need the .
10:50
Hm. That does indeed work, but in this case has an equivalent expression with ⍷. Not sure I see which one is "right"

'foo' 'bar' 'foo' 'baz'∊⊂'foo'
┌→──────┐
│1 0 1 0│
└~──────┘
(⊂'foo')⍷'foo' 'bar' 'foo' 'baz'
┌→──────┐
│1 0 1 0│
└~──────┘
11:01
Specializing to strings, you can think of as looking for substrings:
      ⍸'foo'⍷'foo bar foo baz'
0 8
So the 0th and 8th positions mark where 'foo' begins in the right hand side.
However, if your left argument is just a single character, then it's sort of an edge case where the string start and end are the same.
The same applies if you generalize from strings to vectors of strings, like in your example with .
Since is a "substring search" it's more of a heavyweight option.
Generally, if you're just looking for items matching other items, then you'll want to reach for , and the like.
Thanks! I'll use ∊ now, then
 
6 hours later…
17:04
@B.Wilson Ah, right, I remember that, but I don't remember why we didn't just go with that. Will take it up with Rich.
@JohannesHoff It may be easier to understand≡¨ as in (⊂'foo')≡¨'foo' 'bar' 'foo' 'baz' or 'foo' 'bar' 'foo' 'baz'≡¨⊂'foo' (they are equivalent).

« first day (2873 days earlier)      last day (41 days later) »