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

ID | Project | Category | View Status | Date Submitted | Last Update
0008107 | Part 01: TTCN-3 Core Language | New Feature | public | 09-08-2022 20:10 | 04-01-2023 11:59

Reporter | Matthias Simon |
Assigned To | Jens Grabowski |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version |  | Fixed in Version |  |
Clause Reference(s) | Core Language Spec
Source (company - Author) | Nokia - Matthias Simon

Summary | 0008107: Support for variadic functions

Description

Add support for variadic functions.
DESCRIPTION
The last formal parameter of a (external) function, altstep, testcase, ... may have a type suffixed with ... . A function with such a parameter is called variadic and may be invoked with zero or more arguments for that parameter.
If f is variadic with a last formal parameter p of type T..., then within f the type of p is equivalent to type record of T.
Examples:
external function printf(charstring fmt, any... args);
function avg(integer... values) return integer {
var integer sum;
for (var integer i := 0; i < lengthof(values); i := i + 1) {
sum := sum + values[i]
}
return sum / lengthof(values)
}
avg() // returns 0
avg(1) // returns 1
avg(1, 3) // returns 2

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR8107.docx (116,155) 06-12-2022 14:51 http://oldforge.etsi.org/mantis/file_download.php?file_id=4085&type=bug CR8107(1).docx (115,214) 12-12-2022 12:57 http://oldforge.etsi.org/mantis/file_download.php?file_id=4095&type=bug CR8107-2.docx (147,240) 20-12-2022 09:13 http://oldforge.etsi.org/mantis/file_download.php?file_id=4105&type=bug

Issue History
Date Modified | Username | Field | Change
09-08-2022 20:10 | Matthias Simon | New Issue |
16-08-2022 09:51 | Jens Grabowski | Note Added: 0016214 |
16-08-2022 14:17 | Jens Grabowski | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
17-08-2022 08:11 | Jens Grabowski | Assigned To | => Matthias Simon
17-08-2022 08:11 | Jens Grabowski | Status | new => assigned
06-12-2022 14:51 | Matthias Simon | File Added: CR8107.docx |
06-12-2022 14:53 | Matthias Simon | Status | assigned => confirmed
11-12-2022 12:27 | Matthias Simon | Status | confirmed => assigned
11-12-2022 12:29 | Matthias Simon | Note Added: 0016377 |
11-12-2022 12:29 | Matthias Simon | Assigned To | Matthias Simon => Tomas Urban
11-12-2022 12:29 | Matthias Simon | Status | assigned => confirmed
11-12-2022 16:22 | Matthias Simon | Note Added: 0016378 |
11-12-2022 16:22 | Matthias Simon | Assigned To | Tomas Urban => Matthias Simon
11-12-2022 16:22 | Matthias Simon | Status | confirmed => new
11-12-2022 16:23 | Matthias Simon | Note Added: 0016379 |
11-12-2022 16:23 | Matthias Simon | Assigned To | Matthias Simon => Tomas Urban
11-12-2022 16:23 | Matthias Simon | Status | new => confirmed
12-12-2022 12:31 | Matthias Simon | Note Deleted: 0016378 |
12-12-2022 12:31 | Matthias Simon | Note Deleted: 0016379 |
12-12-2022 12:57 | Matthias Simon | File Added: CR8107(1).docx |
12-12-2022 12:59 | Matthias Simon | Note Added: 0016385 |
20-12-2022 09:13 | Tomas Urban | File Added: CR8107-2.docx |
20-12-2022 09:17 | Tomas Urban | Note Added: 0016430 |
20-12-2022 09:17 | Tomas Urban | Assigned To | Tomas Urban => Matthias Simon
20-12-2022 09:26 | Matthias Simon | Note Added: 0016431 |
20-12-2022 09:27 | Matthias Simon | Assigned To | Matthias Simon => Jens Grabowski
20-12-2022 09:27 | Matthias Simon | Status | confirmed => assigned
20-12-2022 11:47 | Jens Grabowski | Status | assigned => confirmed
04-01-2023 11:59 | Jens Grabowski | Note Added: 0016464 |
04-01-2023 11:59 | Jens Grabowski | Status | confirmed => closed
04-01-2023 11:59 | Jens Grabowski | Resolution | open => fixed

Notes

(0016214)
Jens Grabowski
16-08-2022 09:51

TTF Discussion: Matthias will develop a proposal.

(0016377)
Matthias Simon
11-12-2022 12:29

The first version of the resolution uploaded. Please check and let me know what should be changed or added.

(0016385)
Matthias Simon
12-12-2022 12:59

Added missing syntax for passing "record of" parameters directly. Example: function f1(integer args...) {} var record of integer r := {1,2,3} f1(r...);

(0016430)
Tomas Urban
20-12-2022 09:17

I added missing rules and modified the existing ones. The main principles remained the same. If you are happy with the changes or make only minor correction, please pass it to Jens so that he can take a look too.

(0016431)
Matthias Simon
20-12-2022 09:26

Much better. Thank you Tomas.

(0016464)
Jens Grabowski
04-01-2023 11:59

Implemented as proposed.