Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsm!cbnewsk!pegasus!hansen From: hansen@pegasus.att.com (Tony L. Hansen) Newsgroups: comp.lang.c++ Subject: Re: A question about the use of "rep" in class names Summary: "rep" == "representation" Keywords: rep, classes Message-ID: <1991May2.205519.9982@cbnewsk.att.com> Date: 2 May 91 20:55:19 GMT References: <2239@qtc.UUCP> Sender: hansen@cbnewsk.att.com (tony.l.hansen) Distribution: usa Organization: AT&T Bell Laboratories Lines: 29 < From: stevew@qtc.UUCP (Steve Weston) < < I have a question that has been nagging me for some time. Several < books on C++ ("Programming in C++" by Dewhurst and Stark, and "The C++ < Answer Book" by Tony Hanson) make use of classes with "rep" in the name < for implementing reference counting schemes. Dewhurst and Stark have a < String_rep class, and Hanson has vrep and mrep classes for vector and < matrix classes. Is the similar terminology a coincidence, or does it < come from some language, such as Lisp, or some classic work, such as < Knuth? What does "rep" mean, and what is its history? While I can't speak for Steve Dewhurst and Kathy Stark, I think I can answer for the usage in my book. From my perspective: "rep" == "representation" For example, the String class provides the external interface and the String_rep class provides the true representation of the class itself. For private classes such as these (nested classes which are intended to be used only by the enclosing class), "rep" seems as good a qualifier as anything else. I know that Bjarne Stroustrup also uses the qualifier "srep" in his sample string class from his "The C++ Programming Language". I don't know about other earlier uses of the same terminology. Tony Hansen hansen@pegasus.att.com, tony@attmail.com att!pegasus!hansen, attmail!tony P.S. It's "Hansen", not "Hanson". :-)