[net.lang.c++] Comments on cfront and lists

mat@mtx5a.UUCP (m.terribile) (02/26/86)

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)
    ,..      .,,       ,,,   ..,***_*.