Hello,
It seems that iterators are not supported in rewrite rules? This is
not an issue currently for me (because I can use `sum` instead of
`reduce`), but it might be good to bring it to your attention.
I tried to make a Ruleset like this:
sum_rule := rule
sin(X)^Y == sum(sin(n * X), n = 1..Y)
cos(X)^Y == reduce(_+, [cos('n * X) for n in 1..Y])
Note that the first rule, with sum, works fine. But the second rule
causes this error:
The index variable in an iterator must be a symbol and QUOTEn is not one.
Trying to change the n to a Symbol also doesn't work:
Line 1: sum_rule := rule
Line 2: sin(X)^Y == sum(sin(n * X), n = 1..Y)
Line 3: cos(X)^Y == reduce(_+, [cos(n * X) for "n"::Symbol in 1..Y])
..A......................................B...................C
Error A: (from #\A up to #\C) Ignored.
Error B: Improper syntax.
2 error(s) parsing
Regards,
Neven
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/CAL%2BbK4MiY5B%2Bwv%2BboZmWEA36a6torNYBYdrT%2B4mMYKt7y5FB%3DA%40mail.gmail.com.