Ralf Hemmecke wrote:
>
> > 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.
>
> The syntax
>
> fun/list
>
> is quite unintuitive. I don't think that we should support it.
>
> Waldek, are you saying that
>
>
> fun/[f(x) for x in somelist]
>
> wouldn't create an additional list, namely [f(x) for x in somelist], but
> rather be equivalent to
>
> n := 0
> for x in somelist n := n + f(x)
> n
>
> ?
>
> What is the result of
>
> _+ / []
>
> and
>
> _* / []
>
> ?
Unit of appriate operation if known. If compiler does not know
about operation then empty list give an error.
> I would rather be in favour of Generator(X) in SPAD. That would also not
> create intermediate lists.
Yes, but to get resonable efficiency we need special compiler
support.
--
Waldek Hebisch
--
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.