Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #107910 > unrolled thread
| Started by | Peabody <waybackNO584SPAM44@yahoo.com> |
|---|---|
| First post | 2017-04-08 22:59 -0500 |
| Last post | 2017-04-26 11:09 -0700 |
| Articles | 20 on this page of 187 — 30 participants |
Back to article view | Back to comp.lang.c
And they say C is obscure Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 22:59 -0500
Re: And they say C is obscure Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2017-04-08 22:17 -0600
Re: And they say C is obscure Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-09 07:42 -0500
Re: And they say C is obscure Barry Schwarz <schwarzb@dqel.com> - 2017-04-09 07:46 -0700
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-04-09 16:47 +0200
Re: And they say C is obscure James Kuyper <jameskuyper@verizon.net> - 2017-04-09 14:42 -0400
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-04-09 13:25 -0700
Re: And they say C is obscure James Kuyper <jameskuyper@verizon.net> - 2017-04-09 22:56 -0400
Re: And they say C is obscure Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2017-04-09 15:18 -0600
Re: And they say C is obscure Ken Brody <kenbrody@spamcop.net> - 2017-04-10 12:57 -0400
Re: And they say C is obscure scott@slp53.sl.home (Scott Lurndal) - 2017-04-10 14:46 +0000
Re: And they say C is obscure luser droog <luser.droog@gmail.com> - 2017-04-09 07:26 -0700
Re: And they say C is obscure James Kuyper <jameskuyper@verizon.net> - 2017-04-09 14:18 -0400
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-04-09 20:53 +0100
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-04-09 13:52 -0700
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-04-14 11:48 +0000
Re: And they say C is obscure Ken Brody <kenbrody@spamcop.net> - 2017-04-14 13:36 -0400
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-04-20 13:24 +0000
Re: And they say C is obscure supercat@casperkitty.com - 2017-04-20 08:05 -0700
Re: And they say C is obscure scott@slp53.sl.home (Scott Lurndal) - 2017-04-20 15:32 +0000
Re: And they say C is obscure supercat@casperkitty.com - 2017-04-20 09:48 -0700
Re: And they say C is obscure scott@slp53.sl.home (Scott Lurndal) - 2017-04-20 18:00 +0000
Re: And they say C is obscure supercat@casperkitty.com - 2017-04-20 11:34 -0700
Re: And they say C is obscure scott@slp53.sl.home (Scott Lurndal) - 2017-04-20 18:41 +0000
Re: And they say C is obscure Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-04-09 13:18 -0700
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-04-09 14:03 -0700
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-09 22:56 +0100
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-04-10 09:12 +0200
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-04-10 08:22 -0700
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-10 18:28 +0100
Re: And they say C is obscure scott@slp53.sl.home (Scott Lurndal) - 2017-04-10 17:49 +0000
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-04-10 11:50 -0700
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-10 20:33 +0100
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-04-10 13:06 -0700
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-04-10 21:48 +0100
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-10 22:15 +0100
Re: And they say C is obscure Michael Barry <barrym95838@yahoo.com> - 2017-04-10 18:46 -0700
Re: And they say C is obscure scott@slp53.sl.home (Scott Lurndal) - 2017-04-10 21:46 +0000
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-10 23:09 +0100
Re: And they say C is obscure scott@slp53.sl.home (Scott Lurndal) - 2017-04-11 12:40 +0000
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-11 14:15 +0100
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-26 10:13 -0700
Re: And they say C is obscure supercat@casperkitty.com - 2017-04-26 10:38 -0700
Re: And they say C is obscure supercat@casperkitty.com - 2017-04-10 15:23 -0700
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-04-14 11:51 +0000
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-14 13:14 +0100
Re: And they say C is obscure supercat@casperkitty.com - 2017-04-14 10:42 -0700
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-14 19:04 +0100
Re: And they say C is obscure Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-04-14 21:43 +0100
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-26 11:02 -0700
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-04-26 19:05 +0100
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-04-26 12:02 -0700
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-04-26 21:55 +0100
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-27 00:15 +0100
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-27 13:23 -0700
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-04-14 18:12 +0100
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-14 18:37 +0100
Re: And they say C is obscure GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-04-11 00:03 +0200
Re: And they say C is obscure Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-04-10 14:10 -0700
Re: And they say C is obscure mark.bluemel@gmail.com - 2017-04-11 08:41 -0700
Re: And they say C is obscure supercat@casperkitty.com - 2017-04-11 08:58 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-04-11 09:06 -0700
Re: And they say C is obscure scott@slp53.sl.home (Scott Lurndal) - 2017-04-11 16:46 +0000
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-04-11 19:02 +0100
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-04-14 11:59 +0000
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-26 10:59 -0700
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-04-27 21:40 +0100
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-02 05:17 -0700
Re: And they say C is obscure David Kleinecke <dkleinecke@gmail.com> - 2017-05-03 12:50 -0700
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-05 01:20 -0700
Re: And they say C is obscure David Kleinecke <dkleinecke@gmail.com> - 2017-05-05 12:37 -0700
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-06 00:16 -0700
Re: And they say C is obscure David Kleinecke <dkleinecke@gmail.com> - 2017-05-06 11:49 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-06 13:16 -0700
Re: And they say C is obscure David Kleinecke <dkleinecke@gmail.com> - 2017-05-06 14:10 -0700
Re: And they say C is obscure Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2017-05-06 20:23 -0600
Re: And they say C is obscure David Kleinecke <dkleinecke@gmail.com> - 2017-05-06 21:51 -0700
Re: And they say C is obscure fir <profesor.fir@gmail.com> - 2017-05-07 05:04 -0700
Re: And they say C is obscure fir <profesor.fir@gmail.com> - 2017-05-07 05:09 -0700
Re: And they say C is obscure fir <profesor.fir@gmail.com> - 2017-05-07 05:18 -0700
Re: And they say C is obscure fir <profesor.fir@gmail.com> - 2017-05-07 05:54 -0700
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-05-07 13:48 +0100
Re: And they say C is obscure fir <profesor.fir@gmail.com> - 2017-05-07 06:13 -0700
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-07 15:10 +0200
Re: And they say C is obscure Manfred <noname@invalid.add> - 2017-05-07 16:47 +0200
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-07 21:08 +0200
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-05-07 21:54 +0100
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-08 00:59 +0200
Re: And they say C is obscure David Kleinecke <dkleinecke@gmail.com> - 2017-05-07 16:59 -0700
Re: And they say C is obscure Robert Wessel <robertwessel2@yahoo.com> - 2017-05-07 22:28 -0500
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-08 10:16 +0200
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-08 02:41 -0700
Re: And they say C is obscure fir <profesor.fir@gmail.com> - 2017-05-08 07:36 -0700
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-05-09 10:06 +0000
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-09 14:03 +0200
Re: And they say C is obscure Manfred <noname@invalid.add> - 2017-05-09 19:41 +0200
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-09 21:35 +0200
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-05-09 20:25 +0000
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-10 14:48 +0200
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-10 14:23 +0100
Re: And they say C is obscure Manfred <noname@invalid.add> - 2017-05-10 21:31 +0200
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-05-10 12:45 -0700
Re: And they say C is obscure "James R. Kuyper" <jameskuyper@verizon.net> - 2017-05-10 16:49 -0400
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-07 08:56 -0700
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-08 09:54 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-08 17:32 -0700
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-05-08 18:26 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-09 02:28 -0700
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-05-09 10:15 +0000
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-09 05:53 -0700
Re: And they say C is obscure bartc <bc@freeuk.com> - 2017-05-09 14:15 +0100
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-09 06:55 -0700
Re: And they say C is obscure Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-09 14:43 +0100
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-09 23:07 +0100
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-10 15:32 +0200
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-05-10 11:39 +0000
Re: And they say C is obscure mark.bluemel@gmail.com - 2017-05-09 06:21 -0700
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-11 03:00 -0700
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-05-09 18:20 +0100
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-05-10 10:06 -0700
Re: And they say C is obscure fir <profesor.fir@gmail.com> - 2017-05-10 11:11 -0700
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-10 12:45 +0100
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-10 05:33 -0700
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-10 13:41 +0100
Re: And they say C is obscure Jerry Stuckle <jstucklex@attglobal.net> - 2017-05-10 09:32 -0400
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-10 14:51 +0100
Re: And they say C is obscure Jerry Stuckle <jstucklex@attglobal.net> - 2017-05-10 10:54 -0400
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-10 17:36 +0200
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-10 09:28 -0700
Re: And they say C is obscure Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-10 19:12 +0100
Re: And they say C is obscure me <crisdunbar@gmail.com> - 2017-05-10 11:53 -0700
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-10 22:19 +0200
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-05-11 07:36 +0100
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-11 00:39 -0700
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-11 13:30 +0200
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-11 13:17 +0100
Re: And they say C is obscure Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-11 13:37 +0100
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-12 10:39 +0200
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-13 09:34 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-13 09:48 -0700
Re: And they say C is obscure Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-13 19:48 +0100
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-13 14:01 -0700
Re: And they say C is obscure David Kleinecke <dkleinecke@gmail.com> - 2017-05-13 15:23 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-14 03:14 -0700
[OT] Re: And they say C is obscure Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-14 12:18 +0100
Re: [OT] Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-14 13:28 +0100
Re: [OT] Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-14 15:56 +0200
Re: [OT] Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-14 16:56 +0100
Re: And they say C is obscure Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-14 02:03 +0100
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-14 03:08 -0700
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-14 13:44 +0100
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-14 16:13 +0200
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-14 08:04 -0700
Re: And they say C is obscure luser droog <luser.droog@gmail.com> - 2017-05-14 08:52 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-14 09:16 -0700
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-14 17:48 +0100
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 14:11 -0700
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-14 22:57 +0200
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-05-14 14:10 -0700
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-14 15:51 +0200
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-14 14:04 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-11 07:45 -0700
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-11 16:45 +0100
Re: And they say C is obscure Gareth Owen <gwowen@gmail.com> - 2017-05-11 19:58 +0100
Re: And they say C is obscure Ike Naar <ike@iceland.freeshell.org> - 2017-05-11 22:15 +0000
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-11 23:24 +0100
Re: And they say C is obscure David Brown <david.brown@hesbynett.no> - 2017-05-12 10:50 +0200
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-12 09:57 +0100
Re: And they say C is obscure Jerry Stuckle <jstucklex@attglobal.net> - 2017-05-10 16:31 -0400
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-10 07:50 -0700
Re: And they say C is obscure supercat@casperkitty.com - 2017-05-10 09:00 -0700
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-11 03:03 -0700
Re: And they say C is obscure Keith Thompson <kst-u@mib.org> - 2017-05-11 09:02 -0700
Re: And they say C is obscure Manfred <noname@invalid.add> - 2017-05-12 18:34 +0200
Re: And they say C is obscure Richard Heathfield <rjh@cpax.org.uk> - 2017-05-12 18:47 +0100
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-13 09:03 -0700
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-05-09 10:11 +0000
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-09 08:28 -0700
Re: And they say C is obscure Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-05-09 09:40 -0700
Re: And they say C is obscure raltbos@xs4all.nl (Richard Bos) - 2017-05-09 20:26 +0000
Re: And they say C is obscure fir <profesor.fir@gmail.com> - 2017-05-10 00:20 -0700
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-05-08 09:01 -0700
Re: And they say C is obscure John Bode <jfbode1029@gmail.com> - 2017-04-11 09:15 -0700
Re: And they say C is obscure supercat@casperkitty.com - 2017-04-11 09:29 -0700
Re: And they say C is obscure Manfred <noname@invalid.add> - 2017-04-13 16:00 +0200
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-16 19:45 -0700
Re: And they say C is obscure Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-26 11:09 -0700
Page 3 of 10 — ← Prev page 1 2 [3] 4 5 … 10 Next page →
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2017-04-11 14:15 +0100 |
| Message-ID | <HF4HA.293398$sA1.128103@fx08.am4> |
| In reply to | #108040 |
On 11/04/2017 13:40, Scott Lurndal wrote:
> bartc <bc@freeuk.com> writes:
>> On 10/04/2017 22:46, Scott Lurndal wrote:
>
>>>
>>> Actually, I consider the C 'for' construct to be a natural
>>> extension of the ALGOL and Pascal FOR constructs. They all
>>> provide an initial condition, a terminal condition and an
>>> optional step condition.
>>
>
>>
>> for (i=0,j=1; rand()!=12345; x[++k]='A'){}
>
> Initial condition: i=0, j=1;
> Terminal condition: rand() != 12345
> Step condition: x[++k]='A'
>
> It's pretty damn clear.
Initial condition: Any gobbledygook
Terminal condition: More gobbleydook
Step condition: Yet more random, unrelated nonsense
Sure, it's clear if you don't care whether those conditions mean
anything or not.
>>
>> What are the start and end values of the loop index? You can't answer
>> because there is /no/ loop index. And you can't tell how many iterations
>> this will do.
>
> Nor can you tell, a priori, with "do until" or "while" constructs. So what?
Do you agree that C provides only a low level, general purpose version
of those dedicated for-constructs provided in other languages?
A loop with a control variable, a start and end value, needs at least
those three bits of information, plus some denotation that this is a
loop, so four. A typical syntax is:
for i=1,5
Which is six syntactic elements in total.
A C version would be:
for (i=1; i<=5; ++i)
containing 13 elements.But it has the advantage that the language lets
you make errors like this:
for (i=1; i<5; ++j)
Or lets you have fun like rotating the elements around:
for (i<=5; ++i; i=0)
It's just that some people see this kind of thing as a disadvantage, in
not being able to detect as many errors.
--
bartc
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2017-04-26 10:13 -0700 |
| Message-ID | <kfnzif33xei.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #108018 |
bartc <bc@freeuk.com> writes: > On 10/04/2017 22:46, Scott Lurndal wrote: >> Keith Thompson <kst-u@mib.org> writes: >>> bartc <bc@freeuk.com> writes: >>> >>>> Leaving out 'for' wouldn't have been a great loss, as it is >>>> hardly a proper 'for' statement with the special language >>>> support that normally entails. >>> >>> I think that's the root of your objection. You insist on a "for" >>> loop being similar to the "for" loop that's seen in Algol and >>> Pascal. It isn't. It could have been called, say, "iterate" with >>> exactly the same meaning. >> >> Actually, I consider the C 'for' construct to be a natural >> extension of the ALGOL and Pascal FOR constructs. They all >> provide an initial condition, a terminal condition and an >> optional step condition. > > I can't see any connection (apart from the use of the "for" > keyword). C provides a general purpose, lower level construct > that can emulate a For statement from those other languages. > [...] I think some historical perspective might be in order here. In "high-level languages", the original iteration construct is DO loops in FORTRAN. A DO loop steps an iteration control variable through an arithmetic progression. The original FORTRAN did not have other looping constructs IIANM - any other kind of loop needs to be fabricated using IF and GOTO statements. A few years after FORTRAN came Algol-60. Algol-60 also has just one kind of looping statement in the language (ie, not counting the if/goto kind), named 'for' rather than 'DO'. The Algol-60 'for' statement has a controlled variable, like the FORTRAN DO, but is much richer in terms of loop control: multiple "elements" are allowed, where each "element" may be a single value, a range ala FORTRAN DO, or a pair of "recurring expression and 'while' test", similar to the last two elements of a for() statement in C (except in Algol the recurring expression is evaluated at the start of each iteration rather than at the end). Basic came along about two years after Algol-60, with a 'for' statement essentially the same as DO in FORTRAN (and no other looping constructs). It was important that 'for' be simple, both because Basic itself was designed around being simple, and because it ran in pretty limited hardware environments. (Later versions of Basic added other more elaborate kinds of statements, but they weren't there in the original Basic.) Two or three years after Basic we see a language at the other end of the size/complexity spectrum, PL/I. PL/I also has just one looping construct, which like FORTRAN is named 'DO', but 'DO' in PL/I is richer (in some ways, not all) than 'for' in Algol. Notably, the PL/I 'DO' allows combining "while" tests with a regular arithmetic progression, but also allows "while" tests all by themselves, with no controlled variable at all. Shortly after PL/I was introduced (which was 1965?), its 'DO' statement had still more options, including an Algol-like "recurring expression" and an 'UNTIL' form that is similar to "while" (with the test inverted) but with the test at the end of the loop rather than the beginning - ie, like a do...while() in C. Several years after PL/I came Pascal, which went back to the FORTRAN/Basic style of iteration statement, which it also calls 'for'. Pascal uses a separate 'WHILE' statement for loops with only a test and no controlled variable, and a 'REPEAT' statement for at-least-once style loops. Needless to say, Pascal chose simple versions of control constructs in part because it was intended from the outset as a teaching language. Disclaimer: all the above from memory and/or checked against reference material found on the net, but I have not gone back and checked against the original references in all cases. I expect that what one thinks of as a "traditional for loop" depends a lot one's background. My first language was FORTRAN, followed soon thereafter by PL/I. Somewhere in there I picked up a little Basic but I never took Basic seriously. By the time Pascal became the rage I was well along the path of working in numerous languages, so Pascal wasn't ever anything special for me. Conversely, those whose first language was Basic or Pascal probably got used to those simpler versions of 'for' loops (especially coupled with the 'while' in Pascal) as being the "traditional" form of iteration construct. But the actual history is more complicated than that. For me the limited form of 'for' in Pascal was a special case, because I was well-versed in PL/I by the time I first saw Pascal. I'm sure other people have very much the opposite reaction, especially since Pascal was much more widely learned than PL/I was. Still, before either of those was Algol-60, whose 'for' looping construct is decidely more elaborate than the Basic/Pascal-style 'for' loop.
[toc] | [prev] | [next] | [standalone]
| From | supercat@casperkitty.com |
|---|---|
| Date | 2017-04-26 10:38 -0700 |
| Message-ID | <775a3e2c-0363-4633-9b88-20aab84d7a22@googlegroups.com> |
| In reply to | #108545 |
On Wednesday, April 26, 2017 at 12:13:18 PM UTC-5, Tim Rentsch wrote:
> I expect that what one thinks of as a "traditional for loop"
> depends a lot one's background. My first language was FORTRAN,
> followed soon thereafter by PL/I. Somewhere in there I picked up
> a little Basic but I never took Basic seriously. By the time
> Pascal became the rage I was well along the path of working in
> numerous languages, so Pascal wasn't ever anything special for
> me. Conversely, those whose first language was Basic or Pascal
> probably got used to those simpler versions of 'for' loops
> (especially coupled with the 'while' in Pascal) as being the
> "traditional" form of iteration construct. But the actual
> history is more complicated than that. For me the limited form
> of 'for' in Pascal was a special case, because I was well-versed
> in PL/I by the time I first saw Pascal. I'm sure other people
> have very much the opposite reaction, especially since Pascal
> was much more widely learned than PL/I was. Still, before
> either of those was Algol-60, whose 'for' looping construct is
> decidely more elaborate than the Basic/Pascal-style 'for' loop.
From what I understand, although FORTRAN allowed loops to be written as
either
TOTAL = 0
I=1
1 TOTAL = TOTAL + ARR(I)
I=I+1
IF I .LE. 100 THEN 1
or as
TOTAL = 0
DO 1 I=1,100
TOTAL = TOTAL + ARR(I)
1 CONTINUE
compilers would not be expected to generate the same code for both. A good
compiler would be expected to perform strength reduction on the evaluation
of ARR(I) on any platform where it would be advantageous to do so, but such
optimizations would not be expected given the former construct.
Although PL/I added a lot of functionality to its FOR loops, I think it
maintained a requirement that code not alter the control variable within
the loop. A multi-pass compiler could use one pass to determine which
control variables are definitely not modified within a loop and apply
optimizations based upon that, but languages which forbid changes to
control variables within a loop wouldn't need to scan code for such
changes before applying optimizations.
Is my understanding correct?
[toc] | [prev] | [next] | [standalone]
| From | supercat@casperkitty.com |
|---|---|
| Date | 2017-04-10 15:23 -0700 |
| Message-ID | <b5ca9cf7-ade9-4085-bce5-2e518ddae0c1@googlegroups.com> |
| In reply to | #108016 |
On Monday, April 10, 2017 at 4:47:06 PM UTC-5, Scott Lurndal wrote: > Actually, I consider the C 'for' construct to be a natural > extension of the ALGOL and Pascal FOR constructs. They all > provide an initial condition, a terminal condition and an > optional step condition. Pascal, e.g., limits the > initial condition to be a numeric (or enumeration) which > limits the usefuless of the construct. I'd consider the PL/I form as more of a natural extension; it allows loops to include multiple ranges, processed in sequence, with a compiler figuring out how best to handle them. Otherwise, the style of loop used in Pascal or FORTRAN allows for strength reductions to be performed in even a single-pass-plus-backpatching compiler even before it has analyzed the entire content of a loop. If code branches out of the middle of a loop on the first iteration such strength reduction might be counter-productive, but a compiler wouldn't have to worry about whether a loop's control variable might get changed mid-loop in ways that would cause already-generated code to execute incorrectly on later passes of the loop.
[toc] | [prev] | [next] | [standalone]
| From | raltbos@xs4all.nl (Richard Bos) |
|---|---|
| Date | 2017-04-14 11:51 +0000 |
| Message-ID | <58f0b758.7540093@news.xs4all.nl> |
| In reply to | #108011 |
Keith Thompson <kst-u@mib.org> wrote: > bartc <bc@freeuk.com> writes: > > Leaving out 'for' wouldn't have been a great loss, as it is hardly a > > proper 'for' statement with the special language support that normally > > entails. > > I think that's the root of your objection. You insist on a "for" loop > being similar to the "for" loop that's seen in Algol and Pascal. BASIC. You're trying to argue with someone who pretends to understand only BASIC. > > 'for' is misleading, that's for sure. > > It misleads you. Not even that. > There is no solvable problem here. There is: you're being trolled, and the solution is for you not to let yourself be trolled. Richard
[toc] | [prev] | [next] | [standalone]
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2017-04-14 13:14 +0100 |
| Message-ID | <p23IA.283941$0L.210673@fx12.am4> |
| In reply to | #108125 |
On 14/04/2017 12:51, Richard Bos wrote: > Keith Thompson <kst-u@mib.org> wrote: > >> bartc <bc@freeuk.com> writes: > >>> Leaving out 'for' wouldn't have been a great loss, as it is hardly a >>> proper 'for' statement with the special language support that normally >>> entails. >> >> I think that's the root of your objection. You insist on a "for" loop >> being similar to the "for" loop that's seen in Algol and Pascal. > > BASIC. You're trying to argue with someone who pretends to understand > only BASIC. > >>> 'for' is misleading, that's for sure. >> >> It misleads you. > > Not even that. > >> There is no solvable problem here. > > There is: you're being trolled, and the solution is for you not to let > yourself be trolled. And people here can continue to delude themselves that C's 'for' is superior in all ways to those of any other language. But you can apply quantitative measures that are independent of anyone's subjective opinions, or whether you think that pointing out perceived deficiencies (to people who seem to have fingers in their ears), is 'trolling'. For one, just count the number of tokens that are needed to express a simple loop, and the number of undetectable ways it can go wrong. Then do the same with any Basic, Algol, Pascal, Ada or Fortran equivalent. Sorry, but these facts would be obvious to a child. -- bartc
[toc] | [prev] | [next] | [standalone]
| From | supercat@casperkitty.com |
|---|---|
| Date | 2017-04-14 10:42 -0700 |
| Message-ID | <6492d096-1dc6-4324-b264-c1c26d25b3d4@googlegroups.com> |
| In reply to | #108127 |
On Friday, April 14, 2017 at 7:14:21 AM UTC-5, Bart wrote:
> For one, just count the number of tokens that are needed to express a
> simple loop, and the number of undetectable ways it can go wrong. Then
> do the same with any Basic, Algol, Pascal, Ada or Fortran equivalent.
C's for loop does have one good and useful feature I've not seen in any
other language: an easy choice of whether the end value should be included
or excluded. For the common scenario of a loop which needs to stop one
short of an object's length, there is some benefit to:
for (int i=0; i<length; i++)
versus
For i As Integer = 0 To length - 1
The C-style version needs slightly more tokens because VB.NET defaults to
a step size of 1, and C regards the opening parenthesis as a separate token
from "for", even though it conveys no useful information and is included for
visual balance with the closing parenthesis that separates the last clause
from the body of the loop.
That having been said, such a feature could be provided in other styles of
loop e.g. by using a syntax like:
For i As Integer = 0 Before length
though I've not seen other languages do that.
[toc] | [prev] | [next] | [standalone]
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2017-04-14 19:04 +0100 |
| Message-ID | <Da8IA.401269$UY3.399143@fx11.am4> |
| In reply to | #108138 |
On 14/04/2017 18:42, supercat@casperkitty.com wrote:
> On Friday, April 14, 2017 at 7:14:21 AM UTC-5, Bart wrote:
>> For one, just count the number of tokens that are needed to express a
>> simple loop, and the number of undetectable ways it can go wrong. Then
>> do the same with any Basic, Algol, Pascal, Ada or Fortran equivalent.
>
> C's for loop does have one good and useful feature I've not seen in any
> other language: an easy choice of whether the end value should be included
> or excluded. For the common scenario of a loop which needs to stop one
> short of an object's length, there is some benefit to:
>
> for (int i=0; i<length; i++)
>
> versus
>
> For i As Integer = 0 To length - 1
Yes, that point is rarely brought up. Most of those other languages are
1-based or any-based, not purely 0-based.
That makes the 'for i=a to b' form awkward as it iterates over an
inclusive range.
> The C-style version needs slightly more tokens because VB.NET defaults to
> a step size of 1, and C regards the opening parenthesis as a separate token
> from "for", even though it conveys no useful information and is included for
> visual balance with the closing parenthesis that separates the last clause
> from the body of the loop.
If you exclude parentheses, there are still more tokens, because 'i' is
specified three times; the '<' is needed, and so is '++'.
> That having been said, such a feature could be provided in other styles of
> loop e.g. by using a syntax like:
>
> For i As Integer = 0 Before length
>
> though I've not seen other languages do that.
I've also thought of using a different keyword ('upto' for example), but
the need isn't as great, for example I can say (in one language):
for i in A ...
and it will pick up the bounds of A, which might be anything including
0..N-1. While Python allows:
for i in range(N) # 0 .. N-1
for i in range(A,B) # A .. B-1
Or sometimes you just say: forall x in A; the index doesn't figure at all.
So there are several possibilities that are a little higher level than
the basic 'for' iterating over A-to-B. C's is lower level so there is
less language help if you get it wrong:
for (i=0; i<=sizeof(A)/sizeof(B[0]); ++j) ...
--
bartc
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-04-14 21:43 +0100 |
| Message-ID | <87bmryra8m.fsf@bsb.me.uk> |
| In reply to | #108138 |
supercat@casperkitty.com writes: <snip> > That having been said, such a feature could be provided in other styles of > loop e.g. by using a syntax like: > > For i As Integer = 0 Before length > > though I've not seen other languages do that. Common Lisp (i.e. Lisp as it is today) does that: > (loop for i from 1 to 10 sum i) 55 > (loop for i from 1 below 10 sum i) 45 -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2017-04-26 11:02 -0700 |
| Message-ID | <kfnr30f3v3n.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #108127 |
bartc <bc@freeuk.com> writes: > [...] people here can continue to delude themselves that C's 'for' is > superior in all ways to those of any other language. No one here is saying that, nor do they think it. What is the point of misprepresenting that?
[toc] | [prev] | [next] | [standalone]
| From | Gareth Owen <gwowen@gmail.com> |
|---|---|
| Date | 2017-04-26 19:05 +0100 |
| Message-ID | <87fugvxcvu.fsf@gmail.com> |
| In reply to | #108551 |
Tim Rentsch <txr@alumni.caltech.edu> writes: > bartc <bc@freeuk.com> writes: > >> [...] people here can continue to delude themselves that C's 'for' is >> superior in all ways to those of any other language. > > No one here is saying that, nor do they think it. What is > the point of misprepresenting that? Trolls gotta troll
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2017-04-26 12:02 -0700 |
| Message-ID | <lnh91bm1p9.fsf@kst-u.example.com> |
| In reply to | #108552 |
Gareth Owen <gwowen@gmail.com> writes:
> Tim Rentsch <txr@alumni.caltech.edu> writes:
>> bartc <bc@freeuk.com> writes:
>>> [...] people here can continue to delude themselves that C's 'for' is
>>> superior in all ways to those of any other language.
>>
>> No one here is saying that, nor do they think it. What is
>> the point of misprepresenting that?
>
> Trolls gotta troll
You're not helping.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | Gareth Owen <gwowen@gmail.com> |
|---|---|
| Date | 2017-04-26 21:55 +0100 |
| Message-ID | <87shkudh3b.fsf@gmail.com> |
| In reply to | #108559 |
Keith Thompson <kst-u@mib.org> writes: > Gareth Owen <gwowen@gmail.com> writes: >> Tim Rentsch <txr@alumni.caltech.edu> writes: >>> bartc <bc@freeuk.com> writes: >>>> [...] people here can continue to delude themselves that C's 'for' is >>>> superior in all ways to those of any other language. >>> >>> No one here is saying that, nor do they think it. What is >>> the point of misprepresenting that? >> >> Trolls gotta troll > > You're not helping. Perhaps not, but do you believe attempting to reason with him is? Have you seen any improvement in his behaviour, or his ability to comprehend that his is not the only valid opinion. Do you think he posts in this group to engage in rational discourse, or to provoke people like you? Answer making reference to i) his claim above and ii) his claim that failure to support $ in a variable name meant C was "crippled" . You are free to ignore the myriad of stupid things he's said, but please don't deny they exist. At least my response has the benefit of brevity.
[toc] | [prev] | [next] | [standalone]
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2017-04-27 00:15 +0100 |
| Message-ID | <3S9MA.529216$8b6.179765@fx19.am4> |
| In reply to | #108568 |
On 26/04/2017 21:55, Gareth Owen wrote: > Do you think he posts in this > group to engage in rational discourse You certainly don't. Unless making jibes, insulting posters and bullying counts as rational discourse.
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2017-04-27 13:23 -0700 |
| Message-ID | <kfnr30d38i2.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #108568 |
Gareth Owen <gwowen@gmail.com> writes: > Keith Thompson <kst-u@mib.org> writes: > >> Gareth Owen <gwowen@gmail.com> writes: >>> Tim Rentsch <txr@alumni.caltech.edu> writes: >>>> bartc <bc@freeuk.com> writes: >>>>> [...] people here can continue to delude themselves that C's 'for' is >>>>> superior in all ways to those of any other language. >>>> >>>> No one here is saying that, nor do they think it. What is >>>> the point of misprepresenting that? >>> >>> Trolls gotta troll >> >> You're not helping. > > Perhaps not, but do you believe attempting to reason with him is? I have found that it does, sometimes. > Have > you seen any improvement in his behaviour, or his ability to comprehend > that his is not the only valid opinion. Generally in responding to his posts I think it helps to stay well away from opinion and as much as possible limit my comments to facts. In cases where I do have a non-fact to offer, I try to phrase it as a possible point of view, and not try to convince him of anything. > Do you think he posts in this > group to engage in rational discourse, or to provoke people like you? Oh, probably not either one, at least not primarily. He posts to blow off steam, because something is frustrating him. Taking this viewpoint has let me deal with his remarks more calmly. > Answer making reference to i) his claim above and ii) his claim that > failure to support $ in a variable name meant C was "crippled" . > > You are free to ignore the myriad of stupid things he's said, but please > don't deny they exist. His statements often do take a brisk run into hyperbole, I'll grant you that. > At least my response has the benefit of brevity. I think I understand your reaction, and for a while I had the same reaction myself. Not sure what happened to change that, but I think the change has been one for the better, both for me and for the group at large (including Bart).
[toc] | [prev] | [next] | [standalone]
| From | Gareth Owen <gwowen@gmail.com> |
|---|---|
| Date | 2017-04-14 18:12 +0100 |
| Message-ID | <87vaq652x7.fsf@gmail.com> |
| In reply to | #108125 |
raltbos@xs4all.nl (Richard Bos) writes: >> There is no solvable problem here. > > There is: you're being trolled, and the solution is for you not to let > yourself be trolled. Worth repeating.
[toc] | [prev] | [next] | [standalone]
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2017-04-14 18:37 +0100 |
| Message-ID | <1N7IA.662294$0k4.527346@fx37.am4> |
| In reply to | #108134 |
On 14/04/2017 18:12, Gareth Owen wrote: > raltbos@xs4all.nl (Richard Bos) writes: > >>> There is no solvable problem here. >> >> There is: you're being trolled, and the solution is for you not to let >> yourself be trolled. > > Worth repeating. > FWIW my own opinion is that you more of a troll than anyone else at the minute (that is, of those who are not obviously nutters, or bots). Let's see, you last post was: "Malcolm is incapable of distinguishing between his preferences and Platonic ideals. Its kind of his thing." And before: "That's because he's an idiot." And: "will not work. A (IMHO truly horrible but mostly forgiveable) historical anomaly of the language design." Gasp! An actual technical comment about C. And not only a comment, but a criticism. And, apparently back on form: "and honestly I have no idea why so many non-idiots are still arguing with him. He's 'fir' with better grammar." "Yes, but they're not morons." "Don't forget the reverse vampires" "The working of his mind is not something that mortals should ponder." Thank you for your valuable contributions.
[toc] | [prev] | [next] | [standalone]
| From | GOTHIER Nathan <nathan.gothier@gmail.com> |
|---|---|
| Date | 2017-04-11 00:03 +0200 |
| Message-ID | <20170411000303.b67f00bd8cc3eff47e472796@gmail.com> |
| In reply to | #108010 |
On Mon, 10 Apr 2017 20:33:27 +0100 bartc <bc@freeuk.com> wrote: > No, there is no good reason for that. Syntax of this kind is the > simplest possible thing to add to a language. I disagree. The basic syntax for loops is the combination of label and goto. Actually C is no more than a macro assembler.
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.mclean5@btinternet.com> |
|---|---|
| Date | 2017-04-10 14:10 -0700 |
| Message-ID | <978be33e-9a8e-4fae-bfe0-401b5c38a953@googlegroups.com> |
| In reply to | #108009 |
On Monday, April 10, 2017 at 7:51:20 PM UTC+1, Keith Thompson wrote: > > Again, your opinion that C's for loop is too complicated is perfectly > valid, even though I don't share it. You're free to restrict your own > use as you like, and/or to implement your own preferred ideas in your > own language. > Not too complicated. Too flexible. Part of the reason is that putting restrictions in what can be allowed in the different places actually puts more burden on the compiler. But code like this for(i = 0, j = init_value();; k ? ++i : j = step_value(j,k)) is hard to understand. There's some tricky logic going on with the i's and j's, and a for loop just isn't the place to document that. If C's for had the form for(counter = init_value to end_value, step increment) like Basic then you would always have a concept of "the loop's counting variable" which is the main purpose of a for loop.
[toc] | [prev] | [next] | [standalone]
| From | mark.bluemel@gmail.com |
|---|---|
| Date | 2017-04-11 08:41 -0700 |
| Message-ID | <957f771f-6fc7-4059-a86c-570ba0e54f11@googlegroups.com> |
| In reply to | #108014 |
On Monday, 10 April 2017 22:10:50 UTC+1, Malcolm McLean wrote: > If C's for had the form > > for(counter = init_value to end_value, step increment) > > like Basic then you would always have a concept of "the loop's > counting variable" which is the main purpose of a for loop. So you'd rather it wasn't able to be used to (for example) traverse a linked list - chacun a son gout, I suppose.
[toc] | [prev] | [next] | [standalone]
Page 3 of 10 — ← Prev page 1 2 [3] 4 5 … 10 Next page →
Back to top | Article view | comp.lang.c
csiph-web