Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #29275 > unrolled thread
| Started by | Test <test@.nil.invalid.com> |
|---|---|
| First post | 2012-12-15 15:47 +0200 |
| Last post | 2012-12-20 16:31 -0500 |
| Articles | 10 on this page of 50 — 13 participants |
Back to article view | Back to comp.lang.c
comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Test <test@.nil.invalid.com> - 2012-12-15 15:47 +0200
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-15 14:05 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-12-15 20:26 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-15 20:47 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Les Cargill <lcargill99@comcast.com> - 2012-12-15 15:34 -0600
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-12-16 03:23 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Shao Miller <sha0.miller@gmail.com> - 2012-12-15 16:37 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-15 22:10 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Shao Miller <sha0.miller@gmail.com> - 2012-12-15 17:32 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Keith Thompson <kst-u@mib.org> - 2012-12-15 15:43 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Shao Miller <sha0.miller@gmail.com> - 2012-12-16 02:15 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Keith Thompson <kst-u@mib.org> - 2012-12-16 14:21 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Shao Miller <sha0.miller@gmail.com> - 2012-12-16 18:34 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-17 01:15 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Keith Thompson <kst-u@mib.org> - 2012-12-17 10:30 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-17 16:07 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-17 08:13 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Keith Thompson <kst-u@mib.org> - 2012-12-17 10:33 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-16 01:24 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Shao Miller <sha0.miller@gmail.com> - 2012-12-16 02:19 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-16 13:11 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Shao Miller <sha0.miller@gmail.com> - 2012-12-16 14:51 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-16 21:16 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-17 00:55 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-17 15:08 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-20 10:40 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-12-15 22:09 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-12-15 06:11 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Les Cargill <lcargill99@comcast.com> - 2012-12-15 13:26 -0600
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) James Kuyper <jameskuyper@verizon.net> - 2012-12-15 09:24 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Keith Thompson <kst-u@mib.org> - 2012-12-15 12:21 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) James Kuyper <jameskuyper@verizon.net> - 2012-12-15 16:42 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Philip Lantz <prl@canterey.us> - 2012-12-16 00:09 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) James Kuyper <jameskuyper@verizon.net> - 2012-12-16 08:46 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Keith Thompson <kst-u@mib.org> - 2012-12-16 14:29 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-16 10:30 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-12-17 12:42 +0200
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-12-17 23:07 +0200
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-17 19:31 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-18 01:32 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-17 20:53 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-18 02:29 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-18 05:48 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-12-18 11:26 +0000
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-20 16:20 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Keith Thompson <kst-u@mib.org> - 2012-12-18 03:44 -0800
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) James Kuyper <jameskuyper@verizon.net> - 2012-12-17 22:13 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-18 05:40 -0500
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-12-20 15:14 +0200
Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) pete <pfiland@mindspring.com> - 2012-12-20 16:31 -0500
Page 3 of 3 — ← Prev page 1 2 [3]
| From | pete <pfiland@mindspring.com> |
|---|---|
| Date | 2012-12-17 20:53 -0500 |
| Message-ID | <50CFCC9D.2D2A@mindspring.com> |
| In reply to | #29453 |
Ben Bacarisse wrote:
>
> pete <pfiland@mindspring.com> writes:
>
> > Phil Carmody wrote:
> >> Phil Carmody <thefatphil_demunged@yahoo.co.uk> writes:
> >> > This reinforces something that I've spotted historically
> >> > - there seems to be some strange fetish
> >> > for using the swiss-army for(;;)
> >> > where while() is perfectly suitable.
> >>
> >> Perhaps I should have worded those as just
> >> "for" and "while", I wasn't
> >> trying to imply the "(;;)" part, just the iteration statements.
> >
> > for (;;) is special.
> >
> > while () , doesn't compile,
> > even though K&R 3.5 says that they are equivalent.
>
> That's a very odd reading of the text! I've tried a few times and I
> can't get that meaning from what's written in my K&R.
The for statement
for (expr1; expr2; expr3)
statement
is equivalent to
expr1;
while (expr2) {
statement
expr3;
}
except for the behavior of continue, which is described in 3.7.
--
pete
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2012-12-18 02:29 +0000 |
| Message-ID | <0.d3d5ff8b39c0ee47e50b.20121218022900GMT.874njkayab.fsf@bsb.me.uk> |
| In reply to | #29455 |
pete <pfiland@mindspring.com> writes:
> Ben Bacarisse wrote:
>>
>> pete <pfiland@mindspring.com> writes:
>>
>> > Phil Carmody wrote:
>> >> Phil Carmody <thefatphil_demunged@yahoo.co.uk> writes:
>> >> > This reinforces something that I've spotted historically
>> >> > - there seems to be some strange fetish
>> >> > for using the swiss-army for(;;)
>> >> > where while() is perfectly suitable.
>> >>
>> >> Perhaps I should have worded those as just
>> >> "for" and "while", I wasn't
>> >> trying to imply the "(;;)" part, just the iteration statements.
>> >
>> > for (;;) is special.
>> >
>> > while () , doesn't compile,
>> > even though K&R 3.5 says that they are equivalent.
>>
>> That's a very odd reading of the text! I've tried a few times and I
>> can't get that meaning from what's written in my K&R.
>
> The for statement
>
> for (expr1; expr2; expr3)
> statement
>
> is equivalent to
>
> expr1;
> while (expr2) {
> statement
> expr3;
> }
>
> except for the behavior of continue, which is described in 3.7.
Does it not go on to explain what happens when any/all of expr[123] are
missing? Mine does.
Even if you stopped there and chose to ignore the sentences that follow,
I don't see how you can conclude that the equivalence applies to "for
(;;)". You'd have to be sure that expr[123] can be "empty" and that's
not at all clear. We've been told about expressions in chapter 2, but
none of the have been "empty". We are told, right away, that it's
possible to omit these parts of the for loop, but the special meaning is
explained then and there in the sentences that explain that they can be
omitted.
--
Ben.
[toc] | [prev] | [next] | [standalone]
| From | pete <pfiland@mindspring.com> |
|---|---|
| Date | 2012-12-18 05:48 -0500 |
| Message-ID | <50D049E0.78C5@mindspring.com> |
| In reply to | #29456 |
Ben Bacarisse wrote:
>
> pete <pfiland@mindspring.com> writes:
>
> > Ben Bacarisse wrote:
> >>
> >> pete <pfiland@mindspring.com> writes:
> >>
> >> > Phil Carmody wrote:
> >> >> Phil Carmody <thefatphil_demunged@yahoo.co.uk> writes:
> >> >> > This reinforces something that I've spotted historically
> >> >> > - there seems to be some strange fetish
> >> >> > for using the swiss-army for(;;)
> >> >> > where while() is perfectly suitable.
> >> >>
> >> >> Perhaps I should have worded those as just
> >> >> "for" and "while", I wasn't
> >> >> trying to imply the "(;;)" part, just the iteration statements.
> >> >
> >> > for (;;) is special.
> >> >
> >> > while () , doesn't compile,
> >> > even though K&R 3.5 says that they are equivalent.
> >>
> >> That's a very odd reading of the text! I've tried a few times and I
> >> can't get that meaning from what's written in my K&R.
> >
> > The for statement
> >
> > for (expr1; expr2; expr3)
> > statement
> >
> > is equivalent to
> >
> > expr1;
> > while (expr2) {
> > statement
> > expr3;
> > }
> >
> > except for the behavior of continue, which is described in 3.7.
>
> Does it not go on to explain what happens when any/all of expr[123] are
> missing? Mine does.
>
> Even if you stopped there and chose to ignore the sentences that follow,
> I don't see how you can conclude that the equivalence applies to "for
> (;;)". You'd have to be sure that expr[123] can be "empty" and that's
> not at all clear. We've been told about expressions in chapter 2, but
> none of the have been "empty". We are told, right away, that it's
> possible to omit these parts of the for loop, but the special meaning is
> explained then and there in the sentences that explain that they can be
> omitted.
If 3.5 had said that Superman and his sister
were equivalent except that Superman was a male, as described in 3.7.
and then the text said that Superman had x-ray vision,
I would take that to mean that Supergirl had x-ray vision too.
--
pete
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2012-12-18 11:26 +0000 |
| Message-ID | <0.8f9aceb92cbc0fa096fc.20121218112616GMT.87y5gva9ev.fsf@bsb.me.uk> |
| In reply to | #29459 |
pete <pfiland@mindspring.com> writes:
> Ben Bacarisse wrote:
>>
>> pete <pfiland@mindspring.com> writes:
>>
>> > Ben Bacarisse wrote:
>> >>
>> >> pete <pfiland@mindspring.com> writes:
>> >>
>> >> > Phil Carmody wrote:
>> >> >> Phil Carmody <thefatphil_demunged@yahoo.co.uk> writes:
>> >> >> > This reinforces something that I've spotted historically
>> >> >> > - there seems to be some strange fetish
>> >> >> > for using the swiss-army for(;;)
>> >> >> > where while() is perfectly suitable.
>> >> >>
>> >> >> Perhaps I should have worded those as just
>> >> >> "for" and "while", I wasn't
>> >> >> trying to imply the "(;;)" part, just the iteration statements.
>> >> >
>> >> > for (;;) is special.
>> >> >
>> >> > while () , doesn't compile,
>> >> > even though K&R 3.5 says that they are equivalent.
>> >>
>> >> That's a very odd reading of the text! I've tried a few times and I
>> >> can't get that meaning from what's written in my K&R.
>> >
>> > The for statement
>> >
>> > for (expr1; expr2; expr3)
>> > statement
>> >
>> > is equivalent to
>> >
>> > expr1;
>> > while (expr2) {
>> > statement
>> > expr3;
>> > }
>> >
>> > except for the behavior of continue, which is described in 3.7.
>>
>> Does it not go on to explain what happens when any/all of expr[123] are
>> missing? Mine does.
>>
>> Even if you stopped there and chose to ignore the sentences that follow,
>> I don't see how you can conclude that the equivalence applies to "for
>> (;;)". You'd have to be sure that expr[123] can be "empty" and that's
>> not at all clear. We've been told about expressions in chapter 2, but
>> none of the have been "empty". We are told, right away, that it's
>> possible to omit these parts of the for loop, but the special meaning is
>> explained then and there in the sentences that explain that they can be
>> omitted.
>
> If 3.5 had said that Superman and his sister
> were equivalent except that Superman was a male, as described in 3.7.
> and then the text said that Superman had x-ray vision,
> I would take that to mean that Supergirl had x-ray vision too.
Which is not analogous to what K&R wrote. It does not say that all
forms of "for" can be mapped to the given "while". It says that some
forms (the ones that have three nonempty expressions) can be so mapped.
It then confirms that this is not a universal rule by detailing special
cases and how they affect the correspondence.
--
Ben.
[toc] | [prev] | [next] | [standalone]
| From | pete <pfiland@mindspring.com> |
|---|---|
| Date | 2012-12-20 16:20 -0500 |
| Message-ID | <50D38117.2974@mindspring.com> |
| In reply to | #29460 |
Ben Bacarisse wrote: > > pete <pfiland@mindspring.com> writes: > > > Ben Bacarisse wrote: > >> > >> pete <pfiland@mindspring.com> writes: > >> > >> > Ben Bacarisse wrote: > >> >> > >> >> pete <pfiland@mindspring.com> writes: > >> >> > for (;;) is special. > >> >> > > >> >> > while () , doesn't compile, > >> >> > even though K&R 3.5 says that they are equivalent. > It does not say that all > forms of "for" can be mapped to the given "while". It says that some > forms (the ones that have three nonempty expressions) > can be so mapped. > It then confirms that this is not a universal rule > by detailing special > cases and how they affect the correspondence. Thank you. -- pete
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2012-12-18 03:44 -0800 |
| Message-ID | <lnlicvh9dw.fsf@nuthaus.mib.org> |
| In reply to | #29459 |
pete <pfiland@mindspring.com> writes:
> Ben Bacarisse wrote:
>> pete <pfiland@mindspring.com> writes:
>> > Ben Bacarisse wrote:
>> >> pete <pfiland@mindspring.com> writes:
[...]
>> >> > for (;;) is special.
>> >> >
>> >> > while () , doesn't compile,
>> >> > even though K&R 3.5 says that they are equivalent.
>> >>
>> >> That's a very odd reading of the text! I've tried a few times and I
>> >> can't get that meaning from what's written in my K&R.
>> >
>> > The for statement
>> >
>> > for (expr1; expr2; expr3)
>> > statement
>> >
>> > is equivalent to
>> >
>> > expr1;
>> > while (expr2) {
>> > statement
>> > expr3;
>> > }
>> >
>> > except for the behavior of continue, which is described in 3.7.
>>
>> Does it not go on to explain what happens when any/all of expr[123] are
>> missing? Mine does.
>>
>> Even if you stopped there and chose to ignore the sentences that follow,
>> I don't see how you can conclude that the equivalence applies to "for
>> (;;)". You'd have to be sure that expr[123] can be "empty" and that's
>> not at all clear. We've been told about expressions in chapter 2, but
>> none of the have been "empty". We are told, right away, that it's
>> possible to omit these parts of the for loop, but the special meaning is
>> explained then and there in the sentences that explain that they can be
>> omitted.
>
> If 3.5 had said that Superman and his sister
> were equivalent except that Superman was a male, as described in 3.7.
> and then the text said that Superman had x-ray vision,
> I would take that to mean that Supergirl had x-ray vision too.
The text doesn't say that for loops *in general* are equivalent to
the given while loop. It says that
for (expr1; expr2; expr3)
statement
is equivalent to the given while loop. It refers to a *subset*
of all for loops, i.e., those for which all three exprs are present.
It goes on to say that any or all of expr1, expr2, and expr3 may
be *omitted*, not that any of them may be *empty*. (And the names
imply that they're expressions; there's no such thing as an empty
expression.) If expr1 or expr3 is omitted, it's simply dropped
from the expansion. If expr2 is omitted, K&R doesn't even show an
equivalent while loop; it merely says that the for loop is infinite.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Date | 2012-12-17 22:13 -0500 |
| Message-ID | <kaon1l$gju$1@dont-email.me> |
| In reply to | #29455 |
On 12/17/2012 08:53 PM, pete wrote:
> Ben Bacarisse wrote:
>>
>> pete <pfiland@mindspring.com> writes:
>>
>>> Phil Carmody wrote:
>>>> Phil Carmody <thefatphil_demunged@yahoo.co.uk> writes:
>>>>> This reinforces something that I've spotted historically
>>>>> - there seems to be some strange fetish
>>>>> for using the swiss-army for(;;)
>>>>> where while() is perfectly suitable.
>>>>
>>>> Perhaps I should have worded those as just
>>>> "for" and "while", I wasn't
>>>> trying to imply the "(;;)" part, just the iteration statements.
>>>
>>> for (;;) is special.
>>>
>>> while () , doesn't compile,
>>> even though K&R 3.5 says that they are equivalent.
>>
>> That's a very odd reading of the text! I've tried a few times and I
>> can't get that meaning from what's written in my K&R.
>
> The for statement
>
> for (expr1; expr2; expr3)
> statement
>
> is equivalent to
>
> expr1;
> while (expr2) {
> statement
> expr3;
> }
>
> except for the behavior of continue, which is described in 3.7.
There's a few other differences, the relevant one in this context being
that expr2 is optional if a for() statement, but mandatory in a while()
(6.8.5p1).
Also, what you've called expr1 is called clause-1 in the standard, to
reflect the fact that it can be either an expression or a declaration.
If it is a declaration, any identifiers it declares have a scope that
includes the entire for() statement, but does not extend to the
enclosing block, so you should enclose your 'while' replacement in {},
to give those identifiers the right scope.
--
James Kuyper
[toc] | [prev] | [next] | [standalone]
| From | pete <pfiland@mindspring.com> |
|---|---|
| Date | 2012-12-18 05:40 -0500 |
| Message-ID | <50D04837.3186@mindspring.com> |
| In reply to | #29457 |
James Kuyper wrote:
>
> On 12/17/2012 08:53 PM, pete wrote:
> > Ben Bacarisse wrote:
> >>
> >> pete <pfiland@mindspring.com> writes:
> >>
> >>> Phil Carmody wrote:
> >>>> Phil Carmody <thefatphil_demunged@yahoo.co.uk> writes:
> >>>>> This reinforces something that I've spotted historically
> >>>>> - there seems to be some strange fetish
> >>>>> for using the swiss-army for(;;)
> >>>>> where while() is perfectly suitable.
> >>>>
> >>>> Perhaps I should have worded those as just
> >>>> "for" and "while", I wasn't
> >>>> trying to imply the "(;;)" part, just the iteration statements.
> >>>
> >>> for (;;) is special.
> >>>
> >>> while () , doesn't compile,
> >>> even though K&R 3.5 says that they are equivalent.
> >>
> >> That's a very odd reading of the text!
> >> I've tried a few times and I
> >> can't get that meaning from what's written in my K&R.
> >
> > The for statement
> >
> > for (expr1; expr2; expr3)
> > statement
> >
> > is equivalent to
> >
> > expr1;
> > while (expr2) {
> > statement
> > expr3;
> > }
> >
> > except for the behavior of continue, which is described in 3.7.
>
> There's a few other differences,
> the relevant one in this context being
> that expr2 is optional if a for() statement,
> but mandatory in a while()
> (6.8.5p1).
> Also, what you've called expr1 is called clause-1 in the standard, to
> reflect the fact that it can be either an expression or a declaration.
> If it is a declaration, any identifiers it declares have a scope that
> includes the entire for() statement, but does not extend to the
> enclosing block, so you should enclose your 'while' replacement in {},
> to give those identifiers the right scope.
I was talking about what K&R says
and then quoting K&R in response to Ben Bacarisse.
--
pete
[toc] | [prev] | [next] | [standalone]
| From | Phil Carmody <thefatphil_demunged@yahoo.co.uk> |
|---|---|
| Date | 2012-12-20 15:14 +0200 |
| Message-ID | <87d2y4j26y.fsf@bazspaz.fatphil.org> |
| In reply to | #29447 |
pete <pfiland@mindspring.com> writes: > Phil Carmody wrote: > > Phil Carmody <thefatphil_demunged@yahoo.co.uk> writes: > > > This reinforces something that I've spotted historically > > > - there seems to be some strange fetish > > > for using the swiss-army for(;;) > > > where while() is perfectly suitable. > > > > Perhaps I should have worded those as just "for" and "while", I wasn't > > trying to imply the "(;;)" part, just the iteration statements. > > for (;;) is special. > > while () , doesn't compile, > even though K&R 3.5 says that they are equivalent. Now read what I just wrote, and pay attention to where I say you should ignore the open bracket, the two semicolons, and the closed bracket. Phil -- I'm not saying that google groups censors my posts, but there's a strong link between me saying "google groups sucks" in articles, and them disappearing. Oh - I guess I might be saying that google groups censors my posts.
[toc] | [prev] | [next] | [standalone]
| From | pete <pfiland@mindspring.com> |
|---|---|
| Date | 2012-12-20 16:31 -0500 |
| Message-ID | <50D38398.2DA2@mindspring.com> |
| In reply to | #29514 |
Phil Carmody wrote: > > pete <pfiland@mindspring.com> writes: > > Phil Carmody wrote: > > > Phil Carmody <thefatphil_demunged@yahoo.co.uk> writes: > > > > This reinforces something that I've spotted historically > > > > - there seems to be some strange fetish > > > > for using the swiss-army for(;;) > > > > where while() is perfectly suitable. > > > > > > Perhaps I should have worded those as just "for" and "while", > > > I wasn't > > > trying to imply the "(;;)" part, just the iteration statements. > > > > for (;;) is special. > > > > while () , doesn't compile, > > even though K&R 3.5 says that they are equivalent. > > Now read what I just wrote, > and pay attention to where I say you should ignore the > open bracket, the two semicolons, and the closed bracket. This problem will get worse as I get older. -- pete
[toc] | [prev] | [standalone]
Page 3 of 3 — ← Prev page 1 2 [3]
Back to top | Article view | comp.lang.c
csiph-web