public static QueryIterator getQueryIteratorFromCommand(Cons query) {
    { Stella_Object queryiterator = Logic.evaluateLogicCommand(query, true);

      if ((!Stella_Object.isaP(queryiterator, Logic.SGT_LOGIC_QUERY_ITERATOR)) &&
          (Stella_Object.symbolP(query.value) &&
           Stella.stringEqualP(Native.string_subsequence(((Symbol)(query.value)).symbolName, 0, 3), "ASK"))) {
        queryiterator = Logic.$MOST_RECENT_QUERY$;
      }
      if (!Stella_Object.isaP(queryiterator, Logic.SGT_LOGIC_QUERY_ITERATOR)) {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

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

            try {
              Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
              stream000.nativeStream.println("ERROR: Couldn't generate a query iterator result from `" + query + "'.");
              Logic.helpSignalPropositionError(stream000, Logic.KWD_ERROR);

            } finally {
              Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
            }
          }
          throw ((PropositionError)(PropositionError.newPropositionError(stream000.theStringReader()).fillInStackTrace()));
        }
      }
      return (((QueryIterator)(queryiterator)));
    }
  }