  

<table class="width100" style="width:100%;" data-cellspacing="1">
<colgroup>
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 16%" />
</colgroup>
<tbody>
<tr class="odd">
<td colspan="6" class="form-title"><div class="center">
ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
</div></td>
</tr>
<tr class="even">
<td colspan="6" class="form-title">View Issue Details</td>
</tr>
<tr class="odd">
<td colspan="6" class="print-spacer"><hr /></td>
</tr>
<tr class="even print-category">
<td class="print" width="16%">ID</td>
<td class="print" width="16%">Project</td>
<td class="print" width="16%">Category</td>
<td class="print" width="16%">View Status</td>
<td class="print" width="16%">Date Submitted</td>
<td class="print" width="16%">Last Update</td>
</tr>
<tr class="odd print">
<td class="print">0008153</td>
<td class="print">Part 01: TTCN-3 Core Language</td>
<td class="print">New Feature</td>
<td class="print">public</td>
<td class="print">11-12-2022 19:21</td>
<td class="print">16-12-2024 10:26</td>
</tr>
<tr class="even">
<td colspan="6" class="print-spacer"><hr /></td>
</tr>
<tr class="odd print">
<td class="print-category">Reporter</td>
<td class="print">Matthias Simon</td>
<td colspan="4" class="print"> </td>
</tr>
<tr class="even print">
<td class="print-category">Assigned To</td>
<td class="print">Jens Grabowski</td>
<td colspan="4" class="print"> </td>
</tr>
<tr class="odd print">
<td class="print-category">Priority</td>
<td class="print">normal</td>
<td class="print-category">Severity</td>
<td class="print">minor</td>
<td class="print-category">Reproducibility</td>
<td class="print">have not tried</td>
</tr>
<tr class="even print">
<td class="print-category">Status</td>
<td class="print">resolved</td>
<td class="print-category">Resolution</td>
<td class="print">fixed</td>
<td colspan="2" class="print"> </td>
</tr>
<tr class="odd print">
<td class="print-category">Platform</td>
<td class="print"></td>
<td class="print-category">OS</td>
<td class="print"></td>
<td class="print-category">OS Version</td>
<td class="print"></td>
</tr>
<tr class="even print">
<td class="print-category">Product Version</td>
<td class="print"></td>
<td colspan="4" class="print"> </td>
</tr>
<tr class="odd">
<td class="print-category">Target Version</td>
<td class="print"></td>
<td class="print-category">Fixed in Version</td>
<td class="print"></td>
<td colspan="2" class="print"> </td>
</tr>
<tr class="even print">
<td class="print-category">Clause Reference(s)</td>
<td colspan="4" class="print">19.2, 19.3</td>
<td></td>
</tr>
<tr class="odd print">
<td class="print-category">Source (company - Author)</td>
<td colspan="4" class="print">Nokia - Matthias Simon</td>
<td></td>
</tr>
<tr class="even">
<td colspan="6" class="print-spacer"><hr /></td>
</tr>
<tr class="odd print">
<td class="print-category">Summary</td>
<td colspan="5" class="print">0008153: Extend usage of break and
continue statements</td>
</tr>
<tr class="even print">
<td class="print-category">Description</td>
<td colspan="5" class="print">* Allow break statements in select
statements.<br />
* Allow optional label to break/continue from nested loops</td>
</tr>
<tr class="odd print">
<td class="print-category">Steps To Reproduce</td>
<td colspan="5" class="print"></td>
</tr>
<tr class="even print">
<td class="print-category">Additional Information</td>
<td colspan="5" class="print"></td>
</tr>
<tr class="odd print">
<td class="print-category">Tags</td>
<td colspan="5" class="print">No tags attached.</td>
</tr>
<tr class="even print">
<td class="print-category">Relationships</td>
<td colspan="5" class="print"></td>
</tr>
<tr class="odd print">
<td class="print-category">Attached Files</td>
<td colspan="5" class="print"><img
src="http://oldforge.etsi.org/mantis/images/fileicons/doc.gif"
alt="docx" /> CR8153.docx (114,777) <span class="italic">11-12-2022
20:07</span><br />
http://oldforge.etsi.org/mantis/file_download.php?file_id=4093&amp;type=bug</td>
</tr>
<tr class="even">
<td colspan="6" class="print-spacer"><hr /></td>
</tr>
<tr class="odd">
<td class="form-title">Issue History</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even print-category">
<td class="row-category-history">Date Modified</td>
<td class="row-category-history">Username</td>
<td class="row-category-history">Field</td>
<td class="row-category-history">Change</td>
<td></td>
<td></td>
</tr>
<tr class="odd print">
<td class="print">11-12-2022 19:21</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=1237">Matthias
Simon</a></td>
<td class="print">New Issue</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="even print">
<td class="print">11-12-2022 20:07</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=1237">Matthias
Simon</a></td>
<td class="print">Summary</td>
<td class="print">Add optional label to break and continue =&gt; Extend
usage of break and continue statements</td>
<td></td>
<td></td>
</tr>
<tr class="odd print">
<td class="print">11-12-2022 20:07</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=1237">Matthias
Simon</a></td>
<td class="print">Description Updated</td>
<td class="print">bug_revision_view_page.php?rev_id=607#r607</td>
<td></td>
<td></td>
</tr>
<tr class="even print">
<td class="print">11-12-2022 20:07</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=1237">Matthias
Simon</a></td>
<td class="print">File Added: CR8153.docx</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="odd print">
<td class="print">20-12-2022 12:49</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a></td>
<td class="print">Note Added: 0016441</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="even print">
<td class="print">20-12-2022 12:49</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a></td>
<td class="print">Assigned To</td>
<td class="print">=&gt; Jens Grabowski</td>
<td></td>
<td></td>
</tr>
<tr class="odd print">
<td class="print">20-12-2022 12:49</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a></td>
<td class="print">Status</td>
<td class="print">new =&gt; assigned</td>
<td></td>
<td></td>
</tr>
<tr class="even print">
<td class="print">07-11-2023 17:01</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a></td>
<td class="print">Note Added: 0016542</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="odd print">
<td class="print">09-11-2023 21:15</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=783">Gusztáv
Adamis</a></td>
<td class="print">Note Added: 0016570</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="even print">
<td class="print">10-11-2023 12:03</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=783">Gusztáv
Adamis</a></td>
<td class="print">Note Added: 0016581</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="odd print">
<td class="print">26-01-2024 16:27</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=769">Olivier
Genoud</a></td>
<td class="print">Note Added: 0016608</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="even print">
<td class="print">21-11-2024 18:33</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=1237">Matthias
Simon</a></td>
<td class="print">Note Added: 0016700</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="odd print">
<td class="print">21-11-2024 18:37</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=1237">Matthias
Simon</a></td>
<td class="print">Note Edited: 0016700</td>
<td class="print">bug_revision_view_page.php?bugnote_id=16700#r625</td>
<td></td>
<td></td>
</tr>
<tr class="even print">
<td class="print">16-12-2024 10:26</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a></td>
<td class="print">Note Added: 0016718</td>
<td class="print"></td>
<td></td>
<td></td>
</tr>
<tr class="odd print">
<td class="print">16-12-2024 10:26</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a></td>
<td class="print">Status</td>
<td class="print">assigned =&gt; resolved</td>
<td></td>
<td></td>
</tr>
<tr class="even print">
<td class="print">16-12-2024 10:26</td>
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a></td>
<td class="print">Resolution</td>
<td class="print">open =&gt; fixed</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>

  

<table class="width100" data-cellspacing="1">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr class="odd">
<td colspan="2" class="form-title">Notes</td>
</tr>
<tr class="even">
<td colspan="2" class="print-spacer"><hr /></td>
</tr>
<tr class="odd">
<td class="nopad" data-valign="top" width="20%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">(0016441)</td>
</tr>
<tr class="even">
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a>   </td>
</tr>
<tr class="odd">
<td class="print">20-12-2022 12:49   </td>
</tr>
</tbody>
</table></td>
<td class="nopad" data-valign="top" width="85%"><table class="hide"
data-cellspacing="1">
<colgroup>
<col style="width: 100%" />
</colgroup>
<tbody>
<tr class="odd">
<td class="print">Additional idea: Add label to loop header.<br />
<br />
TTF discussion: To be discussed in the scope of the next TTF. Proposal
cannot be implemented as proposed for select case statement. It would
lead to a backwards incompatible change.</td>
</tr>
</tbody>
</table></td>
</tr>
<tr class="even">
<td colspan="2" class="print-spacer"><hr /></td>
</tr>
<tr class="odd">
<td class="nopad" data-valign="top" width="20%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">(0016542)</td>
</tr>
<tr class="even">
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a>   </td>
</tr>
<tr class="odd">
<td class="print">07-11-2023 17:01   </td>
</tr>
</tbody>
</table></td>
<td class="nopad" data-valign="top" width="85%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">TTF discussion: Break and Continue shall be analysed
in the scope of the major release. Additional ideas include the
deprecation of Goto as well as introduction of breaks/continue across
several scope units.</td>
</tr>
</tbody>
</table></td>
</tr>
<tr class="even">
<td colspan="2" class="print-spacer"><hr /></td>
</tr>
<tr class="odd">
<td class="nopad" data-valign="top" width="20%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">(0016570)</td>
</tr>
<tr class="even">
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=783">Gusztáv
Adamis</a>   </td>
</tr>
<tr class="odd">
<td class="print">09-11-2023 21:15   </td>
</tr>
</tbody>
</table></td>
<td class="nopad" data-valign="top" width="85%"><table class="hide"
data-cellspacing="1">
<colgroup>
<col style="width: 100%" />
</colgroup>
<tbody>
<tr class="odd">
<td class="print">After diiscussions within TTF:<br />
<br />
Possible solution can be "named cycles"<br />
while (...) {<br />
   while (...){<br />
      break w1; //or continue w1;<br />
      }<br />
   } : w1<br />
<br />
break w1; will terminate both cycles, execution continues with the next
instruction after w1.<br />
continue w1; will terminate the innermost cycle and takes the next
iteration of the "w1" cycle.<br />
<br />
Similar construct can be applied for nested alt instructions with
break/repeat "named alt").<br />
<br />
alt {<br />
  [] ...{<br />
          alt {<br />
            [] ... {break a1;}<br />
            ...<br />
          }<br />
        ...<br />
  [] ....<br />
        }<br />
}: a1;<br />
<br />
"altlabels" and "cyclelabels" can be mixed, until they do not "jump" out
of the scope.<br />
<br />
alt {<br />
[] ... { while (...) { break a2;}}<br />
...<br />
}: a2<br />
<br />
If this construct is implemented it may cause to deprecate the
goto/label.</td>
</tr>
</tbody>
</table></td>
</tr>
<tr class="even">
<td colspan="2" class="print-spacer"><hr /></td>
</tr>
<tr class="odd">
<td class="nopad" data-valign="top" width="20%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">(0016581)</td>
</tr>
<tr class="even">
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=783">Gusztáv
Adamis</a>   </td>
</tr>
<tr class="odd">
<td class="print">10-11-2023 12:03   </td>
</tr>
</tbody>
</table></td>
<td class="nopad" data-valign="top" width="85%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">The resolution of the ticket shall be postponed to the
next major revision.</td>
</tr>
</tbody>
</table></td>
</tr>
<tr class="even">
<td colspan="2" class="print-spacer"><hr /></td>
</tr>
<tr class="odd">
<td class="nopad" data-valign="top" width="20%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">(0016608)</td>
</tr>
<tr class="even">
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=769">Olivier
Genoud</a>   </td>
</tr>
<tr class="odd">
<td class="print">26-01-2024 16:27   </td>
</tr>
</tbody>
</table></td>
<td class="nopad" data-valign="top" width="85%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">It seems to be another flavour of "goto", so we do not
see the benefit. On the other hand, it is increasing the complexity of
the language allowing further flavours of code writing. Also, we are not
aware that code cannot be written using existing means.</td>
</tr>
</tbody>
</table></td>
</tr>
<tr class="even">
<td colspan="2" class="print-spacer"><hr /></td>
</tr>
<tr class="odd">
<td class="nopad" data-valign="top" width="20%"><table class="hide"
data-cellspacing="1">
<colgroup>
<col style="width: 100%" />
</colgroup>
<tbody>
<tr class="odd">
<td class="print">(0016700)</td>
</tr>
<tr class="even">
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=1237">Matthias
Simon</a>   </td>
</tr>
<tr class="odd">
<td class="print">21-11-2024 18:33   <br />
(edited on: 21-11-2024 18:37)</td>
</tr>
</tbody>
</table></td>
<td class="nopad" data-valign="top" width="85%"><table class="hide"
data-cellspacing="1">
<colgroup>
<col style="width: 100%" />
</colgroup>
<tbody>
<tr class="odd">
<td class="print">I think you are right. A goto to break a loop is
perfectly fine, even for Dijkstra's standards.<br />
<br />
However, breaking out of loops without using any kind of goto is
possible, but cumbersome and inefficient. For example compare this
linear search algorithm.<br />
<br />
// Using goto<br />
var integer x,y,z;<br />
for (x := 0; x &lt; width; x++) {<br />
    for (y := 0; y &lt; height; y++) {<br />
        for (z := 0; z &lt; depth; z++) {<br />
            if (space[x][y][z] == RedDwarf) {<br />
                goto end;<br />
            }<br />
        }<br />
    }<br />
}<br />
label end;<br />
log("found red dwarf at coords", x,y,z)<br />
<br />
// Using named loops<br />
var integer x,y,z;<br />
L1:<br />
for (x := 0; x &lt; width; x++) {<br />
    for (y := 0; y &lt; height; y++) {<br />
        for (z := 0; z &lt; depth; z++) {<br />
            if (space[x][y][z] == RedDwarf) {<br />
                break L1;<br />
            }<br />
        }<br />
    }<br />
}<br />
log("found red dwarf at coords", x,y,z)<br />
<br />
// Without Goto using booleans<br />
var integer x,y,z;<br />
var boolean found;<br />
for (x := 0; x &lt; width &amp;&amp; not found; x++) {<br />
    for (y := 0; y &lt; height &amp;&amp; not found; y++) {<br />
        for (z := 0; z &lt; depth &amp;&amp; not found; z++) {<br />
            if (space[x][y][z] == RedDwarf) {<br />
                found := true;<br />
            }<br />
        }<br />
    }<br />
}<br />
log("found red dwarf at coords", x-1,y-1,z-1)<br />
<br />
<br />
// Without Goto using functions<br />
var integer x, y, z;<br />
searchSpaceXYZ(space, x, y, z);<br />
log("found red dwarf at coords:, x, y, z);<br />
<br />
function searchSpaceXYZ(record of record of record of Obj space, inout
integer x, inout integer y, inout integer z) boolean {<br />
    for (x := 0; x &lt; lengthof(space); x++) {<br />
        if (searchSpaceYZ(space, x, y, z)) {<br />
            return true;<br />
        }<br />
    }<br />
    return false;<br />
}<br />
<br />
function searchSpaceYZ(record of record of record of Obj space, inout
integer x, inout integer y, inout integer z) boolean {<br />
    for (y := 0; y &lt; lengthof(space[x]); y++) {<br />
        if (searchSpaceZ(space, x, y, z)) {<br />
            return true;<br />
        }<br />
    }<br />
    return false;<br />
}<br />
<br />
function searchSpaceZ(record of record of record of Obj space, inout
integer x, inout integer y, inout integer z) boolean {<br />
    for (z := 0; z &lt; lengthof(space[x][y]); z++) {<br />
        if (space[x][y][z] == RedDwarf) {<br />
            return true;<br />
        }<br />
    }<br />
    return false;<br />
}<br />
<br />
<br />
If I had to rate existing means for readability and code-quality I'd
say:<br />
1. Goto<br />
2. Named-loop<br />
3. Boolean-loop<br />
4. Function-loop<br />
<br />
Place 2 and 3 are very close, because for simple loops boolean-loops are
easier to comprehend. But they can become very ugly and inefficient very
fast.<br />
<br />
After reviewing available options, I personally would stick with the
goto.<br />
<br />
</td>
</tr>
</tbody>
</table></td>
</tr>
<tr class="even">
<td colspan="2" class="print-spacer"><hr /></td>
</tr>
<tr class="odd">
<td class="nopad" data-valign="top" width="20%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">(0016718)</td>
</tr>
<tr class="even">
<td class="print"><a
href="http://oldforge.etsi.org/mantis/view_user_page.php?id=82">Jens
Grabowski</a>   </td>
</tr>
<tr class="odd">
<td class="print">16-12-2024 10:26   </td>
</tr>
</tbody>
</table></td>
<td class="nopad" data-valign="top" width="85%"><table class="hide"
data-cellspacing="1">
<tbody>
<tr class="odd">
<td class="print">Discussion will be continued in Gitlab.</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
