craigda

15 Reputation

2 Badges

15 years, 319 days

MaplePrimes Activity


These are replies submitted by craigda

Thanks for the helpful response.


Sometimes trying to streamline one's example too much leaves out something important.   I'd actually tried many variations with uneval quotes, but failed to mention in my question that I need this as part of a function:

S := x -> sum( x^k,k=0..5);
T := x -> sum( 'x^k',k=0..5); 

S(0);

               0

T(0);

               0

I have been unable to identify a way to define T so that T(0) evaluates to 1.   (Again, this is a cartoon of a much more complicated expression for which splitting out the special cases will be deeply unpleasant.   A procedure that parses the special cases is of course an option, though of last resort in my present situation.)

"add" may help in this example, but this is not the first time I've encountered a problem of essentially this kind, so if there is a "proper" way to do this that I am missing that works along the lines of your examples above, it would be most educational to learn.   

     

Thanks for the helpful response.


Sometimes trying to streamline one's example too much leaves out something important.   I'd actually tried many variations with uneval quotes, but failed to mention in my question that I need this as part of a function:

S := x -> sum( x^k,k=0..5);
T := x -> sum( 'x^k',k=0..5); 

S(0);

               0

T(0);

               0

I have been unable to identify a way to define T so that T(0) evaluates to 1.   (Again, this is a cartoon of a much more complicated expression for which splitting out the special cases will be deeply unpleasant.   A procedure that parses the special cases is of course an option, though of last resort in my present situation.)

"add" may help in this example, but this is not the first time I've encountered a problem of essentially this kind, so if there is a "proper" way to do this that I am missing that works along the lines of your examples above, it would be most educational to learn.   

     

Page 1 of 1