ReplaceRepeated info
- To: mathgroup at smc.vnet.net
- Subject: [mg77673] ReplaceRepeated info
- From: "alexxx.magni at gmail.com" <alexxx.magni at gmail.com>
- Date: Thu, 14 Jun 2007 06:19:30 -0400 (EDT)
Hi everybody, I need to use in my program ReplaceRepeated, and also to know, after it has been applied, how many times a replacement happened. Say, after this: Log[d p q r] Log[a b c d]//.Log[x_ y_] ->Log[x] + Log[y] (Log[a] + Log[b] + Log[c] + Log[d]) (Log[d] + Log[p] + Log[q] + Log[r]) ... I'd need to know that it performed 6 substitutions. There is a way with //. , or have I to resort to some loop around /. , checking myself when no change happens anymore? Thank you! Alessandro Magni