On Mon, Jun 11, 2018 at 8:17 AM, oldk1331 <oldk1...@gmail.com> wrote:
>>> 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.
>>

+1

>> 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.
>

+1

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to