public static Stella_Object coerceStringToPowerloomObject(String value, NamedDescription type, Module module, boolean localP) {
    if (value == null) {
      return (null);
    }
    { Surrogate typesurrogate = Logic.objectSurrogate(type);
      String typename = typesurrogate.symbolName;
      Stella_Object result = null;

      if (typesurrogate == RDBMS.SGT_STELLA_STRING) {
        result = StringWrapper.wrapString(value);
      }
      else if (Stella.stringEqlP(typename, "KEYWORD")) {
        result = Stella.internKeyword(value);
      }
      else if (Stella.stringEqlP(typename, "SEXP")) {
        result = Stella.readSExpressionFromString(value);
      }
      else if (Stella_Object.isaP(typesurrogate.surrogateValue, RDBMS.SGT_LOGIC_NAMED_DESCRIPTION)) {
        result = RDBMS.findOrCreateInstance(value, type, module, localP);
        { Object old$Module$000 = Stella.$MODULE$.get();
          Object old$Context$000 = Stella.$CONTEXT$.get();

          try {
            Native.setSpecial(Stella.$MODULE$, module);
            Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
            Logic.assertIsaProposition(result, typesurrogate);

          } finally {
            Stella.$CONTEXT$.set(old$Context$000);
            Stella.$MODULE$.set(old$Module$000);
          }
        }
      }
      else if (Surrogate.subtypeOfP(typesurrogate, RDBMS.SGT_STELLA_BOOLEAN)) {
        result = (Stella.stringEqlP(value, "1") ? RDBMS.SGT_STELLA_TRUE.surrogateValue : RDBMS.SGT_STELLA_FALSE.surrogateValue);
      }
      else if (Surrogate.subtypeOfP(typesurrogate, RDBMS.SGT_STELLA_INTEGER)) {
        result = IntegerWrapper.wrapInteger(RDBMS.numberStringToInteger(value));
      }
      else if (Surrogate.subtypeOfP(typesurrogate, RDBMS.SGT_STELLA_NUMBER)) {
        result = FloatWrapper.wrapFloat(Native.stringToFloat(value));
      }
      else if (Surrogate.subtypeOfP(typesurrogate, RDBMS.SGT_STELLA_THING)) {
        result = RDBMS.findOrCreateInstance(value, type, module, localP);
      }
      else {
        Stella.STANDARD_WARNING.nativeStream.println("Warning: RDBMS: Don't yet know how to coerce string \"`" + value + "'\" to type `" + typename + "'");
      }
      return (result);
    }
  }