ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0007475 | Part 01: TTCN-3 Core Language | Editorial | public | 11-08-2016 16:35 | 12-12-2016 13:55

Reporter | KristÃ³f Szabados |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.8.1 (published 2016-07) |
Target Version | v4.9.1 (published 2017-05) | Fixed in Version | v4.9.1 (published 2017-05) |
Clause Reference(s) | 6.2.3.0
Source (company - Author) | L. M. Ericsson

Summary | 0007475: Incorect example on indexing

Description

In section 6.2.3.0 the last example (on page 57) is incorrect:
"
var integer v_i[2] := { 1, 2 };
v_myRecordOfArray [v_i] := 2;
// is the same as assigning element v_myRecordOfArray[v_i[0]][v_i[1]]
"
The text of the standard implies that integers have to be used as index: "The index of the first element shall be zero and the index value shall not exceed the limitation placed by length subtyping"

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR7475_resolution_v1.docx (158,138) 16-08-2016 09:02 http://oldforge.etsi.org/mantis/file_download.php?file_id=3447&type=bug

Issue History
Date Modified | Username | Field | Change
11-08-2016 16:35 | KristÃ³f Szabados | New Issue |
12-08-2016 12:51 | Jacob Wieland - Spirent | Note Added: 0014055 |
12-08-2016 15:25 | KristÃ³f Szabados | Note Added: 0014056 |
14-08-2016 18:55 | KristÃ³f Szabados | Note Added: 0014057 |
15-08-2016 09:12 | Jacob Wieland - Spirent | Note Added: 0014058 |
15-08-2016 09:50 | Jens Grabowski | Assigned To | => KristÃ³f Szabados
15-08-2016 09:50 | Jens Grabowski | Status | new => assigned
16-08-2016 09:02 | KristÃ³f Szabados | File Added: CR7475_resolution_v1.docx |
16-08-2016 09:04 | KristÃ³f Szabados | Note Added: 0014082 |
16-08-2016 09:04 | KristÃ³f Szabados | Assigned To | KristÃ³f Szabados => Jacob Wieland - Spirent
16-08-2016 09:04 | KristÃ³f Szabados | Status | assigned => confirmed
16-08-2016 09:09 | Jacob Wieland - Spirent | Note Added: 0014084 |
16-08-2016 09:09 | Jacob Wieland - Spirent | Status | confirmed => resolved
16-08-2016 09:09 | Jacob Wieland - Spirent | Fixed in Version | => v4.8.1 (published 2016-07)
16-08-2016 09:09 | Jacob Wieland - Spirent | Resolution | open => fixed
16-08-2016 09:09 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
17-08-2016 11:47 | Jacob Wieland - Spirent | Status | resolved => feedback
17-08-2016 11:47 | Jacob Wieland - Spirent | Resolution | fixed => reopened
17-08-2016 11:48 | Jacob Wieland - Spirent | Fixed in Version | v4.8.1 (published 2016-07) => v4.9.1 (published 2017-05)
17-08-2016 11:48 | Jacob Wieland - Spirent | Target Version | => v4.9.1 (published 2017-05)
17-08-2016 11:48 | Jacob Wieland - Spirent | Status | feedback => resolved
17-08-2016 11:48 | Jacob Wieland - Spirent | Resolution | reopened => fixed
12-12-2016 13:55 | Gyorgy Rethy | Note Added: 0014386 |
12-12-2016 13:55 | Gyorgy Rethy | Status | resolved => closed

Notes

(0014055)
Jacob Wieland - Spirent
12-08-2016 12:51

The feature that is exemplified by this example is introduced by the following sentence (same section): For nested record of or set of types, an array or record of integer restricted to a single size can be used as a short-hand notation for a nested index notation.

(0014056)
KristÃ³f Szabados
12-08-2016 15:25

But there is no word on how such notation works with loops, shift and rotate operations. At the same time mixing short-hand and not short-hand notations in the same context is a surefire way to create hard to understand and maintain code. Does not seem to be useful in practical situation currently.

(0014057)
KristÃ³f Szabados
14-08-2016 18:55

If I count right this notation is actually longer. In the example to save 2 characters, 24 were added (+ whitespaces). The notation only becomes shorter when working with >26 dimension matrices.

(0014058)
Jacob Wieland - Spirent
15-08-2016 09:12

To use the notation,of course, only makes sense if you use it multiple times. Normally, you would introduce more than one int variable instead of an int-array (so using the int-array is already kind of a shorthand notation).
I really have no idea what you mean with 'how such notation works with loops, shift and rotate operations'. At the moment, these operations are not defined on index-arrays, if that is what you are implying. But, that is an interesting feature one might think about. Since an index-array always represents a flattened index in the corresponding flat array by multiplying with the dimension sizes, an algebra for such int-arrays could be thought defined.
Anyway, at the moment, the standard does not concern itself with that, the only operation allowed as shorthand is the index-operation itself.

(0014082)
KristÃ³f Szabados
16-08-2016 09:04

Please review: - I have extracted the text of the short-hand notation into its own paragraph (this should not be hidden in something else) - I changed the example to show both the short and long notations.

(0014084)
Jacob Wieland - Spirent
16-08-2016 09:09

looks fine to me

(0014386)
Gyorgy Rethy
12-12-2016 13:55

Added to draft V4.8.2