>> The grammar for 'reduce': "func"/[args] >> is not only very strange, but also not applicable in interpreter. >> >> I don't think it's worth the effort that compiler supports this grammar, >> because it should be easilly replaced by "reduce(func, args)", >> so I want to remove this grammar eventually. > > ATM "func"/[args] notation has one big advantage: it does not create > an intermediate list. So it is more efficient than 'reduce(func, args)' > variant. Supporting it in compiler in a sense is almost trivial: > most of code is present anyway to support '[i for i in l]' construct.
OK, if the reason for this grammar is to optimize cases like func/[f(x) for x in g] then we can come up with a function called "mapreduce" mapreduce(func, f, g) to avoid this special compiler treatment. Also this style is more functional than imperative. -- 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.
