Thread View: net.lang.c++
1 messages
1 total messages
Started by m.terribile
Wed, 26 Feb 1986 08:21
Comments on cfront and lists
Author: m.terribile
Date: Wed, 26 Feb 1986 08:21
Date: Wed, 26 Feb 1986 08:21
47 lines
2319 bytes
2319 bytes
Hi,
A few comments on the recent playing I'm doing with C++.
Anyone notice that when playing linked lists, if you stick to
member functions, the language strongly encourages the recursive solution
over the iterative solution?
I may be working in too limited a paradigm, but where one
might reasonably write
for( ; p ; p = p->next )
something( p );
in old C, when using members, one almost has to write
if( p )
{
p->something();
xyz( p->next );
}
Yes, I know that this is what friends are for, but I haven't got a
feeling yet of how much language power is enough, how much is too much, etc.
The more I use cfront, the more I come to respect it. The damn thing
explains argument mismatches of the doggondest sort. And it's ability to
DO things ... inlines, operator definitions, etc, seems phenomenol. Perhaps
Algol 68 translators face some of these problems, but how many of them are
trying to create production variety code? Anyhow, there are two places where
I wish cfront handled errors a little better.
First, in writing inlines w/in classes, there is an annoying tendency
to forget the `;'' befor the closing brace. The translator I have can trip
over itself and take several ``things'' to recover. By the time it does,
it's missing some critical type name, and it really gets unhappy.
There is probably little that can be done about the typename
problem, but is there any chance that the missing semi before a close
brace could be handled a little better?
--
from Mole End Mark Terribile
(scrape .. dig ) mtx5b!mat
(Please mail to mtx5b!mat, NOT mtx5a!
mat, or to mtx5a!mtx5b!mat)
,.. .,, ,,, ..,***_*.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads