> AFAICS typical case is when sel1 is used only once.
It not necessarily used only once, it may get used in a loop.
> Then idiomatic code is
>
> [x for x in list2 for y in list1 | p(y)]
This [x for x in ...] form can only be used for List, not for Vector etc.
While elt(%, List/Vector Boolean) is
On 04/03/2017 03:02 PM, Waldek Hebisch wrote:
> oldk1331 wrote:
>>
>>> For selection elements of lists we have
>>>
>>> [x for x in l| p(x)]
>>>
>>> or 'select'
>>>
>>> I do not see selection bases on list of boolean values
>>> as _much_ better than this.
>>
>>
>> Let's say we use function 'p' app
oldk1331 wrote:
>
> > For selection elements of lists we have
> >
> > [x for x in l| p(x)]
> >
> > or 'select'
> >
> > I do not see selection bases on list of boolean values
> > as _much_ better than this.
>
>
> Let's say we use function 'p' applied on 'list1' to get a list
> of Boolean 'sel1'
> For selection elements of lists we have
>
> [x for x in l| p(x)]
>
> or 'select'
>
> I do not see selection bases on list of boolean values
> as _much_ better than this.
Let's say we use function 'p' applied on 'list1' to get a list
of Boolean 'sel1', then use 'sel1' to select from 'list2'.
oldk1331 wrote:
>
> List should have varies selection function like Matrix:
>
> elt : (%, List(Integer)) -> %
> elt : (%, Segment(Integer)) -> % is supported,
>
> (even List(Segment(Integer)) ?)
>
> I would also like to add
>
> elt : (%, List Boolean) -> %
>
> Of course, these functions are
List should have varies selection function like Matrix:
elt : (%, List(Integer)) -> %
elt : (%, Segment(Integer)) -> % is supported,
(even List(Segment(Integer)) ?)
I would also like to add
elt : (%, List Boolean) -> %
Of course, these functions are not limited to List,
so add Eltable(List I