Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #139242
| Subject | Re: if cargo blocks |
|---|---|
| Newsgroups | comp.lang.c, comp.lang.c++ |
| References | <q084io$qe1$1@dont-email.me> <1HNVD.208806$DWh1.86871@fx36.am4> <q08b57$54q$1@dont-email.me> <gKTVD.49503$gX2.21792@fx32.am4> <q0919m$9gi$1@dont-email.me> |
| From | Bart <bc@freeuk.com> |
| Message-ID | <fMVVD.49941$gX2.33011@fx32.am4> (permalink) |
| Organization | virginmedia.com |
| Date | 2018-12-30 02:07 +0000 |
Cross-posted to 2 groups.
On 29/12/2018 23:52, Rick C. Hodgin wrote:
> On 12/29/2018 6:49 PM, Bart wrote:
>>> if (x)
>>> {
>>> nexttest; // Continues with the "else if (y)" test
>>> gotest zlabel; // Go to the "else if (z)" test
>>>
>>> } else if (y) {
>>> // Code here
>>> prevtest; // Retest "else if (y)" block
>>> gotest last; // Go to the else block
>>>
>>> } else if (z) zlabel {
>>> if (whatever)
>>> out; // Leave the if-block
>>>
>>> } else last {
>>> // Code here
>>> }
>> You've just reinvented spaghetti code I think. And loops.
>
> The spaghetti code exists when you don't have in, out, and enter. The
> features I've added to CAlive, including flow {..} blocks, and now the
> cargo blocks, remove spaghetti code, and place a direct type of flow
> control to one's code without using gotos, without using anything other
> than structured programming.
'gotest' is not a kind of goto?
Without goto, then with the form of if-else chain above, exactly one
branch is expected to be executed each time you enter the first 'if'.
And it will continue execution (subject to break, continue, return,
exit() or longjmp()) following the final }.
As for the execution path of your example, it's anyone's guess. After
'if' is entered, more than one block could be executed, and a block
could be executed multiple times.
Structured programming it isn't.
--
bart
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 10:42 -0500
Re: if cargo blocks David Brown <david.brown@hesbynett.no> - 2018-12-29 17:26 +0100
Re: if cargo blocks Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2018-12-29 16:32 +0000
Re: if cargo blocks Bart <bc@freeuk.com> - 2018-12-29 16:56 +0000
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 12:34 -0500
Re: if cargo blocks Bart <bc@freeuk.com> - 2018-12-29 23:49 +0000
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 18:52 -0500
Re: if cargo blocks Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2018-12-30 00:12 +0000
Re: if cargo blocks rbowman <bowman@montana.com> - 2018-12-29 19:04 -0700
Re: if cargo blocks Ralf Goertz <me@myprovider.invalid> - 2018-12-30 06:12 +0100
Re: if cargo blocks David Brown <david.brown@hesbynett.no> - 2018-12-30 15:23 +0100
Language (Was: if cargo blocks) gazelle@shell.xmission.com (Kenny McCormack) - 2018-12-30 15:39 +0000
Re: Language (Was: if cargo blocks) rbowman <bowman@montana.com> - 2018-12-30 11:23 -0700
Re: if cargo blocks Ralf Goertz <me@myprovider.invalid> - 2018-12-31 05:21 +0100
Re: if cargo blocks David Brown <david.brown@hesbynett.no> - 2018-12-31 18:09 +0100
Re: if cargo blocks rbowman <bowman@montana.com> - 2018-12-31 12:22 -0700
Re: if cargo blocks Ralf Goertz <me@myprovider.invalid> - 2019-01-01 12:04 +0100
Re: if cargo blocks rbowman <bowman@montana.com> - 2018-12-31 11:50 -0700
Re: if cargo blocks Ralf Goertz <me@myprovider.invalid> - 2019-01-01 11:43 +0100
Re: if cargo blocks Ralf Goertz <me@myprovider.invalid> - 2019-01-01 14:27 +0100
German grammar (Was: if cargo blocks) gazelle@shell.xmission.com (Kenny McCormack) - 2019-01-01 14:17 +0000
Re: if cargo blocks rbowman <bowman@montana.com> - 2019-01-01 11:04 -0700
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2019-01-01 10:38 -0800
Re: if cargo blocks rbowman <bowman@montana.com> - 2019-01-01 10:57 -0700
DDR Ralf Goertz <me@myprovider.invalid> - 2019-01-01 21:18 +0100
Re: DDR rbowman <bowman@montana.com> - 2019-01-01 16:18 -0700
Re: if cargo blocks Siri Cruise <chine.bleu@yahoo.com> - 2019-01-01 16:30 -0800
Re: if cargo blocks rbowman <bowman@montana.com> - 2018-12-30 11:09 -0700
Re: if cargo blocks Ralf Goertz <me@myprovider.invalid> - 2018-12-31 05:43 +0100
Re: if cargo blocks rbowman <bowman@montana.com> - 2018-12-31 12:06 -0700
Linguistics. Re: if cargo blocks Siri Cruise <chine.bleu@yahoo.com> - 2019-01-01 16:27 -0800
Re: Linguistics. Re: if cargo blocks rbowman <bowman@montana.com> - 2019-01-01 22:30 -0700
Re: Linguistics. Re: if cargo blocks Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2019-01-02 04:18 -0700
Re: if cargo blocks Bart <bc@freeuk.com> - 2018-12-30 02:07 +0000
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 21:59 -0500
Re: if cargo blocks rbowman <bowman@montana.com> - 2018-12-29 13:57 -0700
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 16:03 -0500
Re: if cargo blocks Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2018-12-29 21:32 +0000
Re: if cargo blocks rbowman <bowman@montana.com> - 2018-12-29 16:06 -0700
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 18:15 -0500
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2018-12-29 15:32 -0800
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2018-12-29 15:34 -0800
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2018-12-29 15:38 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 15:40 -0800
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2018-12-29 15:45 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 18:36 -0500
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2018-12-29 15:42 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 15:45 -0800
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2018-12-29 15:54 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 18:58 -0500
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2018-12-29 16:01 -0800
Re: if cargo blocks "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-29 13:36 -0800
Re: if cargo blocks "I Set My Girlfriend's Pantyhose on Fire" <cdalten@gmail.com> - 2018-12-29 13:16 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-29 16:32 -0500
Re: if cargo blocks Siri Cruise <chine.bleu@yahoo.com> - 2018-12-30 13:00 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-30 16:12 -0500
Re: if cargo blocks Siri Cruise <chine.bleu@yahoo.com> - 2018-12-30 13:31 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-30 16:45 -0500
Re: if cargo blocks Bart <bc@freeuk.com> - 2018-12-30 22:17 +0000
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-30 17:22 -0500
Re: if cargo blocks "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-12-30 20:25 -0800
Re: if cargo blocks Ian Collins <ian-news@hotmail.com> - 2019-01-03 09:50 +1300
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-01-02 15:54 -0500
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-01-02 16:29 -0500
Re: if cargo blocks mark.bluemel@gmail.com - 2019-01-03 00:44 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-01-03 08:17 -0500
Re: if cargo blocks mark.bluemel@gmail.com - 2019-01-03 05:40 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-01-03 09:15 -0500
You are so full of shit (Was: if cargo blocks) gazelle@shell.xmission.com (Kenny McCormack) - 2019-01-03 13:42 +0000
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2019-01-03 12:27 -0800
Re: if cargo blocks Ian Collins <ian-news@hotmail.com> - 2019-01-04 11:11 +1300
Re: if cargo blocks "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2019-01-03 14:37 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-01-03 17:48 -0500
Re: if cargo blocks fir <profesor.fir@gmail.com> - 2019-01-03 14:59 -0800
Re: if cargo blocks mark.bluemel@gmail.com - 2019-01-03 00:44 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-01-03 08:19 -0500
Re: if cargo blocks mark.bluemel@gmail.com - 2019-01-03 05:43 -0800
Re: if cargo blocks "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-01-03 05:51 -0800
Re: if cargo blocks "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2019-01-03 13:22 -0800
Re: if cargo blocks Ian Collins <ian-news@hotmail.com> - 2019-01-04 11:10 +1300
csiph-web