Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100665

Re: (Execution) Termination bit, Alternation bit.

From "Skybuck Flying" <skybuck2000@hotmail.com>
Newsgroups alt.comp.borland-delphi, alt.comp.lang.borland-delphi, comp.arch, comp.lang.c, comp.lang.python
References (1 earlier) <9Bldy.3723$Bz5.1578@fx04.iad> <864af$56760c5f$d47876e2$48630@news.ziggo.nl> <QHody.3724$Bz5.3354@fx04.iad> <d8c28$56769027$d47876e2$58902@news.ziggo.nl> <n579ju$boh$2@speranza.aioe.org>
Subject Re: (Execution) Termination bit, Alternation bit.
Date 2015-12-21 13:40 +0100
Message-ID <f0986$5677f334$d47876e2$26800@news.ziggo.nl> (permalink)
Organization Ziggo

Cross-posted to 5 groups.

Show all headers | View raw


The original idea I posted is less about sending a signal to another 
processor.

It is more about how to break out of an instruction sequence.

Example of problem:

Main:
while Condition1 do
begin
    while Condition2 do
    begin
        while Condition3 do
        begin
            Routine1
        end
    end;
end;

Routine1:

while Condition4 do
begin
    while Condition5 do
    begin
        Routine2:
    end;
end;

Routine2:

while Condition6 do
begin
    while Condition7 do
    begin

    end;
end;

Breaking out of these kinds of loops, routines, code currently requires 
something like:

Current cumbersome solution for problem:

Main:
while Condition1 and not Terminated do
begin
    while Condition2 and not Terminated do
    begin
        while Condition3 and not Terminated do
        begin
            Routine1
        end
    end;
end;

Routine1:

while Condition4 and not Terminated do
begin
    while Condition5 and not Terminated do
    begin
        Routine2:
    end;
end;

Routine2:

while Condition6 and not Terminated do
begin
    while Condition7 and not Terminated do
    begin

    end;
end;

It can take a long while before all this code exits, plus the Terminated 
boolean is probably placed on wrong side.

It should be on the left side in case the Conditions are actual functions 
otherwise those would unnecessarily be executed as well.

Having something that can immediatly exit all of this code would be a nice 
feature to have.

Perhaps something like an exception block, perhaps it could be called a 
termination block.

Routine1:
Result = False

Execute
    while True do
    begin

    end;
    Result = True
Termination
    OnTerminate:
    begin

    end;
end;

return Result

Preferrably , optionally this can be omitted/left out.

Bye,
  Skybuck. 

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

(Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-12-19 18:56 +0100
  Re: (Execution) Termination bit, Alternation bit. Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-19 21:27 -0500
  Re: (Execution) Termination bit, Alternation bit. Chris Angelico <rosuav@gmail.com> - 2015-12-20 14:44 +1100
  Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-12-20 12:25 +0100
    Re: (Execution) Termination bit, Alternation bit. Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-20 11:21 -0500
    Re: (Execution) Termination bit, Alternation bit. eryk sun <eryksun@gmail.com> - 2015-12-20 22:04 -0600
    Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-12-21 13:40 +0100
      Re: (Execution) Termination bit, Alternation bit. Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-21 12:57 -0500
        Re: (Execution) Termination bit, Alternation bit. Grant Edwards <invalid@invalid.invalid> - 2015-12-21 19:32 +0000
          Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-12-29 12:25 +0100
            Re: (Execution) Termination bit, Alternation bit. Steven D'Aprano <steve@pearwood.info> - 2015-12-30 00:22 +1100
              Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-12-29 22:43 +0100
                Re: (Execution) Termination bit, Alternation bit. Chris Angelico <rosuav@gmail.com> - 2015-12-30 11:00 +1100
                Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2016-01-03 02:18 +0100
                Re: (Execution) Termination bit, Alternation bit. Steven D'Aprano <steve@pearwood.info> - 2016-01-03 19:44 +1100
                Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2016-01-08 12:59 +0100
          Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-12-29 12:42 +0100
      Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-12-22 16:46 +0100
        Re: (Execution) Termination bit, Alternation bit. Chris Angelico <rosuav@gmail.com> - 2015-12-23 02:56 +1100
          Re: (Execution) Termination bit, Alternation bit. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-12-29 12:23 +0100
  Re: (Execution) Termination bit, Alternation bit. Rustom Mody <rustompmody@gmail.com> - 2015-12-29 20:07 -0800
    Re: (Execution) Termination bit, Alternation bit. Steven D'Aprano <steve@pearwood.info> - 2015-12-30 23:56 +1100
      Re: (Execution) Termination bit, Alternation bit. Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-30 12:19 -0500

csiph-web