On Sun, Jun 24, 2018 at 10:42 PM, Waldek Hebisch <[email protected]> wrote: > oldk1331 wrote: >> >> But for 'min'/'max', the 'map' paradigm is not very suitable. >> The appropriate way is to use 'reduce'. > > Well, one can use imperative 'map' to implement 'reduce'. > The point is that 'map' is the only place which _must_ > know how to iterate over an aggregate. Given 'map' > all other kinds of iteration may be build in generic > way.
You can use 'map' to implement 'reduce', but that's not the optimized way. In your version, you used "Union" and "Reference", that's wrapped twice, so your version has many unnecessary memory accesses. I didn't say this in previous thread because I though this was obvious... >> Can I commit my original patch? > > If you insist yes, this is too small thing to make much > fuss about it. However, in general you should note > that rewriting code against wish of original author > is not nice thing. Question of style are hard to > judge objectively and may lead to heated debates. > Simple rules like "do not change code without > strong reason" and "in doubt original author is > right" help to avoid many problems. I hope you can understand my performance concern (and aesthetic reason: it's strange to use 'map' with a side effect function). -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
