Re: [fricas-devel] Re: [aldor-devel] foldl and foldr

2017-02-16 Thread Peter Broadbery
On 14 Feb 2017 08:03, "Ralf Hemmecke" wrote: On 02/14/2017 08:38 AM, Peter Broadbery wrote: > Interesting. It definitely does work in .spad files (search for ^+\[). Oh... https://github.com/fricas/fricas/blob/master/src/algebra/aggcat.spad#L146 count(f : S -> Boolean, c :

Re: [fricas-devel] Re: [aldor-devel] foldl and foldr

2017-02-14 Thread Waldek Hebisch
> > On 02/14/2017 08:38 AM, Peter Broadbery wrote: > > Interesting. It definitely does work in .spad files (search for ^+\[). > > Oh... > > https://github.com/fricas/fricas/blob/master/src/algebra/aggcat.spad#L146 > > count(f : S -> Boolean, c : %) == _+/[1 for x in parts c | f x] > > Then

Re: [fricas-devel] Re: [aldor-devel] foldl and foldr

2017-02-14 Thread Ralf Hemmecke
On 02/14/2017 08:38 AM, Peter Broadbery wrote: > Interesting. It definitely does work in .spad files (search for ^+\[). Oh... https://github.com/fricas/fricas/blob/master/src/algebra/aggcat.spad#L146 count(f : S -> Boolean, c : %) == _+/[1 for x in parts c | f x] Then it even looks like a

[fricas-devel] Re: [aldor-devel] foldl and foldr

2017-02-13 Thread Peter Broadbery
Interesting. It definitely does work in .spad files (search for ^+\[). In any case, as written it's left to right. There's an argument that it should be undefined - ie require an associative argument (for parallel accumulation) but that is likely to be more work than I have time for at the

[fricas-devel] Re: [aldor-devel] foldl and foldr

2017-02-13 Thread Ralf Hemmecke
Can it be that this /-fold-notation is interpreter-only in FriCAS? fricas/src/algebra> grep '^[ "_]*/[ "]*:' *.spad catdef.spad: "/": (%,%) -> % catdef.spad: "/": (%,%) -> % ++ x/y is the same as x times the inverse of y. catdef.spad:"/" : (%, S) -> %