WITH statement

Root Boy Jim rbj at icst-cmr
Thu Jul 24 05:59:48 AEST 1986


	Ideally.  Though I had a job one time translation large chunks
	of Pascal code to C.  This was on a large CAD project, in other
	words, a big, non trivial, etc. example of Pascal.  There were
	sections of the Pascal code with 5-10 levels of nested WITH
	statements.  You get identifiers flying around all over the
	place, with no concept as to which structures they belong to
	(at least, not without referring to about six pages of RECORD
	declarations to track them down). Its may be very nice to have
	the WITH construct available when writing code, but its main
	purpose when maintaining or translating code is to create
	confusion and obstruct the real purpose of the code you're
	examining.  It could lead to more efficient code when used
	properly, though I wonder if anyone thinks of the troubles
	involved when using it on a large sca be believed!

While I'm no lover of Pascal, I CAN offer a porting solution. But
first you must answer one question: Would you be happier (I didn't
say `happy', I said `happi-ER') porting the code without the WITH's?
You would? Good! Here's how.

First you need the original Pascal compiler. Then you change all the
`WITH p^'s to `WITH xp^'s, that is bogusize the WITH, but preserve
the original name. Then fix all the errors by prepending `p^' where
necessary, and remove the with statement. Yow!

Now you are ready for all the other headaches.

	(Root Boy) Jim Cottrell		<rbj at icst-cmr.arpa>
This ASEXUAL PIG really BOILS my BLOOD...He's so..so.....URGENT!!



More information about the Comp.lang.c mailing list