Re: [fricas-devel] List selection functions

2017-04-03 Thread oldk1331
> 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

Re: [fricas-devel] List selection functions

2017-04-03 Thread Ralf Hemmecke
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

Re: [fricas-devel] List selection functions

2017-04-03 Thread Waldek Hebisch
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'

Re: [fricas-devel] List selection functions

2017-04-02 Thread oldk1331
> 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'.

Re: [fricas-devel] List selection functions

2017-04-02 Thread Waldek Hebisch
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

[fricas-devel] List selection functions

2017-03-13 Thread oldk1331
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