*/
  public Cons reverse() {
    { Cons self = this;

      if (self == Stella.NIL) {
        return (self);
      }
      { Cons reversedconslist = self;
        Cons remainingconslist = reversedconslist.rest;
        Cons detachedcons = null;

        if (remainingconslist == Stella.NIL) {
          return (reversedconslist);
        }
        reversedconslist.rest = Stella.NIL;
        while (!(remainingconslist == Stella.NIL)) {
          detachedcons = remainingconslist;
          remainingconslist = remainingconslist.rest;
          detachedcons.rest = reversedconslist;
          reversedconslist = detachedcons;
        }
        return (reversedconslist);
      }
    }
  }