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

ID | Project | Category | View Status | Date Submitted | Last Update
0007149 | Part 01: TTCN-3 Core Language | New Feature | public | 19-08-2015 12:54 | 10-12-2015 16:14

Reporter | Tomas Urban |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.7.1 (published 2015-06) |
Target Version | v4.8.1 (published 2016-07) | Fixed in Version | v4.8.1 (published 2016-07) |
Clause Reference(s) | 5.4.2
Source (company - Author) | STF 487

Summary | 0007149: Allow to skip actual out parameters

Description

In cases when the user is not interested in getting an out parameter value, it should be allowed to skip the actual out parameter. This is similar to calling a function without saving the returned value. See the following example:
function f_out(out integer p_out) return integer {
// compute p_out and the function result
return v_res;
}
control {
var integer v_num := f_out(-); // not interested in getting the out parameter
}

Steps To Reproduce |
Additional Information |
Tags | technically agreed

Relationships

related to | 0007114 | closed | Gyorgy Rethy | Actual parameters of out formal value parameters not defined
related to | 0007148 | closed | Gyorgy Rethy | Parameters of functions started as PTC behaviour

Attached Files

CR7149_resolution_v1.docx (87,990) 25-09-2015 14:47
http://oldforge.etsi.org/mantis/file_download.php?file_id=3293&type=bug
CR7149_resolution_v2.docx (91,049) 12-10-2015 15:37
http://oldforge.etsi.org/mantis/file_download.php?file_id=3295&type=bug
CR7149_resolution_v3.docx (91,786) 13-10-2015 12:51
http://oldforge.etsi.org/mantis/file_download.php?file_id=3300&type=bug
CR7149_resolution_v3-problem.docx (69,169) 15-10-2015 13:59
http://oldforge.etsi.org/mantis/file_download.php?file_id=3320&type=bug

Issue History
Date Modified | Username | Field | Change
19-08-2015 12:54 | Tomas Urban | New Issue |
20-08-2015 13:17 | Jacob Wieland - Spirent | Note Added: 0013173 |
20-08-2015 13:22 | Jacob Wieland - Spirent | Note Added: 0013174 |
21-08-2015 09:47 | Tomas Urban | Note Added: 0013175 |
21-09-2015 10:27 | Gyorgy Rethy | Target Version | => v4.8.1 (published 2016-07)
21-09-2015 16:29 | Gyorgy Rethy | Tag Attached: technically agreed |
21-09-2015 16:30 | Gyorgy Rethy | Note Added: 0013227 |
21-09-2015 16:30 | Gyorgy Rethy | Relationship added | related to 0007148
24-09-2015 12:41 | Axel Rennoch | Assigned To | => Axel Rennoch
24-09-2015 12:41 | Axel Rennoch | Status | new => assigned
25-09-2015 14:44 | Axel Rennoch | File Added: CR7149_resolution_v1.docx |
25-09-2015 14:44 | Axel Rennoch | Note Added: 0013317 |
25-09-2015 14:45 | Axel Rennoch | Assigned To | Axel Rennoch => Jacob Wieland - Spirent
25-09-2015 14:45 | Axel Rennoch | Status | assigned => feedback
25-09-2015 14:46 | Axel Rennoch | File Deleted: CR7149_resolution_v1.docx |
25-09-2015 14:47 | Axel Rennoch | File Added: CR7149_resolution_v1.docx |
12-10-2015 11:58 | Gyorgy Rethy | Note Added: 0013353 |
12-10-2015 15:37 | Jacob Wieland - Spirent | File Added: CR7149_resolution_v2.docx |
12-10-2015 15:40 | Jacob Wieland - Spirent | Note Added: 0013358 |
12-10-2015 15:40 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
12-10-2015 15:40 | Jacob Wieland - Spirent | Status | feedback => confirmed
13-10-2015 12:23 | Gyorgy Rethy | File Added: CR7149_resolution_v3.docx |
13-10-2015 12:25 | Gyorgy Rethy | Relationship added | related to 0007114
13-10-2015 12:26 | Gyorgy Rethy | Relationship deleted | related to 0007114
13-10-2015 12:39 | Gyorgy Rethy | Relationship added | related to 0007114
13-10-2015 12:51 | Gyorgy Rethy | Note Added: 0013368 |
13-10-2015 12:51 | Gyorgy Rethy | File Deleted: CR7149_resolution_v3.docx |
13-10-2015 12:51 | Gyorgy Rethy | File Added: CR7149_resolution_v3.docx |
13-10-2015 12:51 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jens Grabowski
13-10-2015 12:51 | Gyorgy Rethy | Status | confirmed => assigned
13-10-2015 12:52 | Gyorgy Rethy | Note Added: 0013369 |
13-10-2015 12:52 | Gyorgy Rethy | Status | assigned => confirmed
15-10-2015 13:59 | Jens Grabowski | File Added: CR7149_resolution_v3-problem.docx |
15-10-2015 14:00 | Jens Grabowski | Note Added: 0013411 |
15-10-2015 14:01 | Jens Grabowski | Assigned To | Jens Grabowski => Gyorgy Rethy
15-10-2015 14:01 | Jens Grabowski | Status | confirmed => assigned
15-10-2015 14:30 | Jacob Wieland - Spirent | Note Added: 0013415 |
15-10-2015 14:31 | Jacob Wieland - Spirent | Note Added: 0013416 |
15-10-2015 14:31 | Jacob Wieland - Spirent | Status | assigned => confirmed
02-11-2015 14:40 | Gyorgy Rethy | Status | confirmed => resolved
02-11-2015 14:40 | Gyorgy Rethy | Fixed in Version | => v4.8.1 (published 2016-07)
02-11-2015 14:40 | Gyorgy Rethy | Resolution | open => fixed
10-12-2015 16:14 | Gyorgy Rethy | Note Added: 0013580 |
10-12-2015 16:14 | Gyorgy Rethy | Status | resolved => closed

Notes

(0013173)
Jacob Wieland - Spirent
20-08-2015 13:17

I wholeheartedly agree, I have been toying with the same idea for some time.

(0013174)
Jacob Wieland - Spirent
20-08-2015 13:22

in a similar vein, it should be possible to pass a non-variable (i.e. constant expression) to an inout parameter. Here, the following equivalence would be established: f(E) is equivalent to f(v) where var T v := E; Basically, an anonymous variable would be filled with the evaluation of expression E and passed to the inout parameter. The result value will be discarded when the function is finished.

(0013175)
Tomas Urban
21-08-2015 09:47

I like the idea of the anonymous variable. It would be useful not only for passing expressions to inout formal parameters, but also as a solution for passing variables to functions started on other components (see 0007148 for more details).

(0013227)
Gyorgy Rethy
21-09-2015 16:30

STF discussion: feature makes sense. Detailed resolution text to be developed.

(0013317)
Axel Rennoch
25-09-2015 14:44

Please check the initial resolution v1.

(0013353)
Gyorgy Rethy
12-10-2015 11:58

My understanding is that the agreement was for the out parameters only. The "-" makes it explicit that the user doesn't want to store the actual out parameter value. This is easy and clear from the user's point of view.
I'm far not so sure about the inout parameter case. Testers - though should be - are not programmers. This change would make a complicated language even more complicated for them. In fact, the workaround for the inout parameters is just one additional line:
var Mytype v_tmp := <expression>
f(v_tmp);
inout parameterization is by reference (by definition); now are we going to break this (?) and say: it is by reference if, but by value if...
expressions may contain variables, if expression is allowed, further questions may/will come up, like does the variables in the expression be changed when the parameter is manipulated within the function? etc. I'm sure other questions to be clarified will come up as well. I know that all these questions can be answered, but all this would make the whole thing so complicated that I believe, it doesn't worth it; just to eliminate one line of code that btw. makes the behaviour clear and visible.

(0013358)
Jacob Wieland - Spirent
12-10-2015 15:40

changed according to last comment, please review new file. Made dash-usage consistent, i.e. if a trailing parameter-list contains only dashes (regardless whether for in parameters with defaults or for out parameters), these can be left out.

(0013368)
Gyorgy Rethy
13-10-2015 12:51

CR7149_resolution_v3.docx: additional sentence on skipping out parameters is also added to the new paragraph on value out parameters coming from CR7114 (paragraph itself may change in CR7114, the purpose here is just to have the additional sentence in this CR).

(0013369)
Gyorgy Rethy
13-10-2015 12:52

Jens, please also review it.

(0013411)
Jens Grabowski
15-10-2015 14:00

Apart from the duplication of one paragraph, see file: CR7149_resolution_v3-problem.docx, the resolution is ok.

(0013415)
Jacob Wieland - Spirent
15-10-2015 14:30

The duplicated sentence is correct as it appears in two different contexts. The first paragraph has the context of formal value out parameters and the other paragraph has the context of formal template out parameters.

(0013416)
Jacob Wieland - Spirent
15-10-2015 14:31

reviewed again, to me it is resolved, please resolve if you agree

(0013580)
Gyorgy Rethy
10-12-2015 16:14

Added to draft V4.7.4