* @param moduleName
   * @param environment
   * @return PlIterator
   */
  public static PlIterator sRetrieve(String query, String moduleName, Environment environment) {
    { Cons queryform = Stella.NIL;
      Context module = PLI.safelyGetModule(moduleName, environment);

      { Module mdl000 = ((Module)(module));
        Context cxt000 = mdl000;

        if (mdl000 == null) {
          mdl000 = ((Module)(Stella.$MODULE$.get()));
          cxt000 = ((Context)(Stella.$CONTEXT$.get()));
        }
        { Object old$Module$000 = Stella.$MODULE$.get();
          Object old$Context$000 = Stella.$CONTEXT$.get();

          try {
            Native.setSpecial(Stella.$MODULE$, mdl000);
            Native.setSpecial(Stella.$CONTEXT$, cxt000);
            environment = environment;
            synchronized (Logic.$POWERLOOM_LOCK$) {
              { Stella_Object sexp = null;
                SExpressionIterator iter000 = InputStream.sExpressions(InputStringStream.newInputStringStream(query));
                Cons collect000 = null;

                while (iter000.nextP()) {
                  sexp = iter000.value;
                  if (collect000 == null) {
                    {
                      collect000 = Cons.cons(sexp, Stella.NIL);
                      if (queryform == Stella.NIL) {
                        queryform = collect000;
                      }
                      else {
                        Cons.addConsToEndOfConsList(queryform, collect000);
                      }
                    }
                  }
                  else {
                    {
                      collect000.rest = Cons.cons(sexp, Stella.NIL);
                      collect000 = collect000.rest;
                    }
                  }
                }
              }
            }

          } finally {
            Stella.$CONTEXT$.set(old$Context$000);
            Stella.$MODULE$.set(old$Module$000);
          }
        }
      }
      return (PLI.retrieve(queryform, ((Module)(module)), environment));
    }
  }