Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!ukc!ox-prg!bill From: bill@robots.oxford.ac.uk (Bill Triggs) Newsgroups: comp.lang.c++ Subject: 'soft' or calculated class members Message-ID: <1875@culhua.prg.ox.ac.uk> Date: 14 Jun 91 19:50:49 GMT Sender: news@prg.ox.ac.uk Lines: 32 I have recently been pushing the suggestion that 'soft' or calculated class members would be easy to implement in C++, and would be a useful extension of the language. The basic idea is that while it is good OOP style to 'wrap' class member access with method calls (for reasons given below), the resulting code is made difficult to understand by the resulting brackets, and the valuable conceptual difference between "little operations which just access state" and "big operations which actually do something" is blurred when everything is done with an explicit function call. Soft members are class *methods* which can be invoked by a syntax identical to ordinary *member* accesses (ie, 'foo.bar' not 'foo.bar()'). They can be used to simulate non-existent 'notional' class members, for various extremely useful housekeeping tasks, and for easier maintenance of backward compatibility. I would like to get the ANSI C++ committee to at least consider the introduction of soft members into C++, as I think they would be a great benefit to the language. I posted a detailed proposal on the net a few weeks ago and the response was favourable, so I have now posted some patches which implement soft-members for g++ - look in the gnu.g++.help newsgroup if you want more details... -- Bill Triggs Oxford University Computing Laboratory 11 Keble Rd Oxford OX1 3QD