[net.lang.c] WITH statement in C

dlc@zog.cs.cmu.edu.UUCP (07/11/86)

     I dislike Pascal as much as the next C hacker, but one feature that could
be useful to add to C is something akin to the Pascal "WITH" statement.  Since
I haven't seen or read X3J11, I don't know if any new features are being added
to the language.  By using  such a construct, one avoids long statements when
using deeply nested structures/unions or the kludgy method of using defines.
I would mail this to a committee member, but I don't the address of any and
I figure one of them will probably read this.  In general, I don't advocate
adding new features to a language (after all, eventually it just turns into
creeping featurism :-), but some improvements are O.K.  I know everybody
seems that they want some pet construct/function/option in the ANSI standard,
so I'm no better than anyone else.  I'm only curious as to why nobody has
mentioned the desire for this construct (or bitched about its abscence :-)

Daryl Clevenger

P.S.
    I am not a frustrated Pascal user either, I detest the language.
    Also, no complete signature line, since I have no idea what the path
    to my site is through UUCP or anything but direct ARPA mail.

gemini@homxb.UUCP (07/12/86)

>      I dislike Pascal as much as the next C hacker, but one feature that could
> be useful to add to C is something akin to the Pascal "WITH" statement.  
> 
> Daryl Clevenger

	I like this feature too, if for no other reason than: it reduces the
	possibilities of having to look at someones code which is wider than
	80 columns on a display with only 80 columns.  (There are still a lot
	of 132 column junkies out there who like to carry around those massive
	tomes of output.)

	The only serious Pascal program I ever wrote was 3-Demon, which many
	of you may have seen on RBBS's (well serious in size, not in function!).

	I recall only two joys in using the language: the opportunity to
	use a WITH statement, and the Microsoft-ism of allowing '[' and ']'
	as synonyms for BEGIN and END.

Rick Richardson, PC Research, Inc. (201) 922-1134, (201) 834-1378 @ AT&T-CP
..!ihnp4!castor!{rer,pcrat!rer} <--Replies to here, not to homxb!gemini, please.

u557676751ea@deneb.UUCP (07/12/86)

> 
>      I dislike Pascal as much as the next C hacker, but one feature that could
> be useful to add to C is something akin to the Pascal "WITH" statement.  Since
> I haven't seen or read X3J11, I don't know if any new features are being added
> to the language.  By using  such a construct, one avoids long statements when
> using deeply nested structures/unions or the kludgy method of using defines.
> I would mail this to a committee member, but I don't the address of any and
> I figure one of them will probably read this.  In general, I don't advocate
> adding new features to a language (after all, eventually it just turns into
> creeping featurism :-), but some improvements are O.K.  I know everybody
> seems that they want some pet construct/function/option in the ANSI standard,
> so I'm no better than anyone else.  I'm only curious as to why nobody has
> mentioned the desire for this construct (or bitched about its abscence :-)
> 
> Daryl Clevenger
> 
> P.S.
>     I am not a frustrated Pascal user either, I detest the language.
>     Also, no complete signature line, since I have no idea what the path
>     to my site is through UUCP or anything but direct ARPA mail.


How about this?

    {
	someptr *foo;

        foo = &(incredibly->long->and->complicated->nested->structure);
        foo->bar = 0;
        foo->bar2 = x;
        .
        .
        .
    }



- Mark Nagel

ucdavis!u557676751ea@ucbvax.berkeley.edu               (ARPA)
...!{dual|lll-crg|ucbvax}!ucdavis!deneb!u557676751ea   (UUCP)