#include "seq.h" // Note the "", not <>, causes this // directory to be searched as well as the // standard places implied by <>. #include // Given a list of strings, return a (new) list with one string // substituted for the other string. Seq subst(const string & oldString, const string & newString, const Seq & SL) { if (SL.empty()) return SL; else if (!SL.empty()) { if (SL.hd() == oldString) return Seq(newString, subst(oldString, newString, SL.tl())); else return Seq(SL.hd(), subst(oldString, newString, SL.tl())); } }