#include "seq.h"	// Note the "", not <>, causes this
			// directory to be searched as well as the
			// standard places implied by <>.
#include <string>

// Given a list of strings, return a (new) list with one string
// substituted for the other string.
Seq<string> subst(const string & oldString, const string & newString,
		  const Seq<string> & SL) {
  if (SL.empty())
    return SL;
  else if (!SL.empty()) {
    if (SL.hd() == oldString)
      return Seq<string>(newString, subst(oldString, newString, SL.tl()));
    else
      return Seq<string>(SL.hd(), subst(oldString, newString, SL.tl()));
  }
}