public static String evaluateLogicCommandInModule(String command, String modulename, boolean finalizeP) {
    { Module module = Stella.getStellaModule(modulename, false);
      Stella_Object result = null;

      if (module == null) {
        module = ((Module)(Stella.$MODULE$.get()));
      }
      try {
        { 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.$LAZY_SATELLITE_RULESp$ = false;
            result = Logic.evaluateLogicCommand(InputStream.readSExpression(InputStringStream.newInputStringStream(command), new Object[1]), finalizeP);
            if (result == null) {
              return ("");
            }
            else if (Stella_Object.stringP(result)) {
              return (((StringWrapper)(result)).wrapperValue);
            }
            else {
              { OutputStringStream resultstream = OutputStringStream.newOutputStringStream();
                org.powerloom.PrintableStringWriter nativestream = resultstream.nativeStream;

                { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();
                  Object old$PrintprettyP$000 = Stella.$PRINTPRETTYp$.get();

                  try {
                    Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
                    Native.setBooleanSpecial(Stella.$PRINTPRETTYp$, true);
                    if (result != null) {
                      resultstream.nativeStream.print(result);
                    }

                  } finally {
                    Stella.$PRINTPRETTYp$.set(old$PrintprettyP$000);
                    Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
                  }
                }
                return (resultstream.theStringReader());
              }
            }

          } finally {
            Stella.$CONTEXT$.set(old$Context$000);
            Stella.$MODULE$.set(old$Module$000);
          }
        }
      } catch (java.lang.Exception e) {
        throw ((java.lang.RuntimeException)(((java.lang.RuntimeException)(e)).fillInStackTrace()));
      }
    }
  }