* @param errorP
   * @return String
   */
  public static String coerceValueToString(Stella_Object value, boolean errorP) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(value);

      if (Surrogate.subtypeOfStringP(testValue000)) {
        { StringWrapper value000 = ((StringWrapper)(value));

          return (value000.wrapperValue);
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Stella.SGT_STELLA_GENERALIZED_SYMBOL)) {
        { GeneralizedSymbol value000 = ((GeneralizedSymbol)(value));

          return (value000.symbolName);
        }
      }
      else if (Surrogate.subtypeOfIntegerP(testValue000)) {
        { IntegerWrapper value000 = ((IntegerWrapper)(value));

          return (Native.integerToString(((long)(value000.wrapperValue))));
        }
      }
      else if (Surrogate.subtypeOfLongIntegerP(testValue000)) {
        { LongIntegerWrapper value000 = ((LongIntegerWrapper)(value));

          return (Native.integerToString(value000.wrapperValue));
        }
      }
      else if (Surrogate.subtypeOfFloatP(testValue000)) {
        { FloatWrapper value000 = ((FloatWrapper)(value));

          return (Native.floatToString(value000.wrapperValue));
        }
      }
      else {
      }
    }
    if (errorP) {
      { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        stream000.nativeStream.print("coerce-value-to-string: don't know how to coerce `" + value + "'");
        throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    else {
      return (null);
    }
  }