//
// The beginning of an eval() demonstration
//

//
// First define two functions for evaluating string matrices.
//

evalm = function ( M )
{
  local (m, i)

  if (class (M) != "string") 
  {
    error ("evalm: argument must be class string");
  }

  for (i in 1:M.n)
  {
    m[i] = eval (M[i]);
  }

  return m;
};

eval2m = function ( M )
{
  local (m)

  // The first time
  m = evalm (M);

  //
  // Now do it again if the result
  // is all string
  //

  if (class (m) != "string")
  {
    return m;
  else
    return evalm (m);
  }
};
