It's easier than that. Your solution is:
*∨/ (⊂'bar') ⍷ x*
This is because X⍷Y returns a list of the elements of X that matches Y.
Then ∨/ is just a reduction of that.
Regards,
Elias
On 9 May 2014 11:56, Blake McBride <[email protected]> wrote:
> Forgive the question, but my experience is only with the original APL and
> not APL2. I have a (general array) vector. Each element is a string
> vector. For example:
>
> x←'abcd' 'efg' 'hijkl'
>
> Now, if I have:
>
> y←'hijkl'
>
> z←'hhh'
>
> How can I tell if y is in x? How can I tell if z is in x?
>
> I can easily do this with a loop, but that's not APL.
>
> This is as far as I've gotten:
>
> x∘.=y
>
> (I am one function away from completing a keyed files system for GNU APL!)
>
> Thanks!
>
> Blake
>
>