Dear Jens, On Tue, Jul 15, 2008 at 08:58:09AM +0200, Jens Vollinga wrote:
see http://www.ginac.de/pipermail/ginac-devel/2006-April/000942.html for an explanation.
Thanks, now I understand my mistake.
This fragment looks a bit confusing. it->match(p, repl_lst) can change repl_lst, so iterators become invalid. Fortunately, in that case match returns true, so we jump out of the loop.
This statement is incorrect. The manual (ginac.texi) says: 4419 This function returns @code{true} when the expression matches the pattern 4420 and @code{false} if it doesn't. If used in the second form, the actual 4421 subexpressions matched by the wildcards get returned in the @code{repls} 4422 object as a list of relations of the form @samp{wildcard == expression}. 4423 If @code{match()} returns false, @code{repls} is undefined. I propose to change this (a bit confusing) behaviour and leave repls unchanged if the expression does not match the pattern. Best regards, Alexei -- All science is either physics or stamp collecting.