public static Cons list$(Cons values) {
    { Cons headcons = Stella.NIL;
      Stella_Object answer = null;
      Cons lastcons = null;

      { Stella_Object v = null;
        Cons iter000 = values;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          v = iter000.value;
          headcons = Cons.cons(v, headcons);
        }
      }
      answer = headcons.rest.reverse();
      if (answer == Stella.NIL) {
        answer = headcons.value;
        return (((Cons)(answer)));
      }
      lastcons = ((Cons)(answer));
      while (!(lastcons.rest == Stella.NIL)) {
        lastcons = lastcons.rest;
      }
      lastcons.rest = ((Cons)(headcons.value));
      return (((Cons)(answer)));
    }
  }