[comp.lang.c++] A question about the use of "rep" in class names

stevew@qtc.UUCP (Steve Weston) (05/02/91)

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?

Steve Weston
uunet!sequent!qtc

hansen@pegasus.att.com (Tony L. Hansen) (05/03/91)

< 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". :-)