bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] String element of general array


From: David B. Lamkins
Subject: Re: [Bug-apl] String element of general array
Date: Thu, 08 May 2014 22:35:55 -0700

The outer product approach is APL 1.

In APL 2, you can enclose the search term and test for membership in the
list:

      ll←'abd' 'defgh' 'ij' 'klm'
      ll∊⊂'ij'
0 0 1 0
      ll∊⊂'foo'
0 0 0 0


On Thu, 2014-05-08 at 22:56 -0500, Blake McBride 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
> 
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]