K
Kenny McCormack
Some other thread drifted off into this topic, but I feel it deserves a
thread of its own.
I have frequently been an advocate of adding the 'break n' construct from
the standard Unix shell to C, since there are situations where you would
like to break out of more than one loop. It seems harmless enough; like
everything else in the world, if you don't like it, don't use it. But for
some reason, suggesting it makes some people's blood pressure rise.
I should also add that part of the problem is that 'break' is overloaded.
If you are in a 'switch' statement inside of a 'for' or 'while' statement,
you can't break out of the loop. It seems pretty clear to me that if we had
it to do all over again, we'd use some other verb in the 'switch' context
(C-shell has 'breaksw'...).
This was written in response to another poster who was arguing against the
"break label" idea. Explanation: "break label" is the often-advanced
counter-proposal to "break level", in which instead of allowing, say, "break
2;", you allow "break somewhere;", the later construct being, as far as I
can tell, exactly equivalent to "goto somewhere;".
As you can see, I also don't see the point in "break label" at the
bits-and-bytes-assembler-level, but I think the following things can be said
in its defense:
1) It avoids the dreaded "g word" from soiling up your pristine code.
2) It may well be the case that arbitraryily targeted "goto"s are not
allowed and that a "syntactic" "break label" construct could be
implemented to "goto" places that one could not otherwise "goto".
It is, thus, 2) above that is most interesting from a discussion
point-of-view. It has never been clear to me, which "goto"s are allowed in
C (since I very rarely use goto, except in the simplest cases) and, in fact,
if any are disallowed.
--
"The anti-regulation business ethos is based on the charmingly naive notion
that people will not do unspeakable things for money." - Dana Carpender
Quoted by Paul Ciszek (pciszek at panix dot com). But what I want to know
is why is this diet/low-carb food author doing making pithy political/economic
statements?
Nevertheless, the above quote is dead-on, because, the thing is - business
in one breath tells us they don't need to be regulated (which is to say:
that they can morally self-regulate), then in the next breath tells us that
corporations are amoral entities which have no obligations to anyone except
their officers and shareholders, then in the next breath they tell us they
don't need to be regulated (that they can morally self-regulate) ...
thread of its own.
I have frequently been an advocate of adding the 'break n' construct from
the standard Unix shell to C, since there are situations where you would
like to break out of more than one loop. It seems harmless enough; like
everything else in the world, if you don't like it, don't use it. But for
some reason, suggesting it makes some people's blood pressure rise.
I should also add that part of the problem is that 'break' is overloaded.
If you are in a 'switch' statement inside of a 'for' or 'while' statement,
you can't break out of the loop. It seems pretty clear to me that if we had
it to do all over again, we'd use some other verb in the 'switch' context
(C-shell has 'breaksw'...).
The current break and continue statements can also be replaced
by goto. For that matter, all control statements can be replaced
by goto and if.
This was written in response to another poster who was arguing against the
"break label" idea. Explanation: "break label" is the often-advanced
counter-proposal to "break level", in which instead of allowing, say, "break
2;", you allow "break somewhere;", the later construct being, as far as I
can tell, exactly equivalent to "goto somewhere;".
As you can see, I also don't see the point in "break label" at the
bits-and-bytes-assembler-level, but I think the following things can be said
in its defense:
1) It avoids the dreaded "g word" from soiling up your pristine code.
2) It may well be the case that arbitraryily targeted "goto"s are not
allowed and that a "syntactic" "break label" construct could be
implemented to "goto" places that one could not otherwise "goto".
It is, thus, 2) above that is most interesting from a discussion
point-of-view. It has never been clear to me, which "goto"s are allowed in
C (since I very rarely use goto, except in the simplest cases) and, in fact,
if any are disallowed.
--
"The anti-regulation business ethos is based on the charmingly naive notion
that people will not do unspeakable things for money." - Dana Carpender
Quoted by Paul Ciszek (pciszek at panix dot com). But what I want to know
is why is this diet/low-carb food author doing making pithy political/economic
statements?
Nevertheless, the above quote is dead-on, because, the thing is - business
in one breath tells us they don't need to be regulated (which is to say:
that they can morally self-regulate), then in the next breath tells us that
corporations are amoral entities which have no obligations to anyone except
their officers and shareholders, then in the next breath they tell us they
don't need to be regulated (that they can morally self-regulate) ...