Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: List restriction combined with length

List restriction combined with length 17 Jul 2008 13:16 #7380

  • Jes
  • Jes's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
Hi all,

Looking in the Core Language document (6.1.2.5.2 section) I find this
example:

type charstring MyCharStr10 ("gr", "xyz") length (4);
// contains no value (empty type).

Does it make any sense to have an empty type? Is there a historical
reason?

Best regards,
--

BELEN2 Firma

Jes
The administrator has disabled public write access.

List restriction combined with length 18 Jul 2008 07:16 #7381

Hi,

No it makes not, at least not in this form (it may make sense to add an empty record for example as a placeholder for future protocol extensions - some encodings are able to skip the unknown elements added later).

The example says that the language do not want to constrain such use artificially, even if it is generally considered to be useless.

BR, Gyorgy


________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Jesús Domínguez Colino
Sent: Thursday, 17 July, 2008 3:16 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: List restriction combined with length


Hi all,

Looking in the Core Language document (6.1.2.5.2 section) I find this example:

type charstring MyCharStr10 ("gr", "xyz") length (4);
// contains no value (empty type).

Does it make any sense to have an empty type? Is there a historical reason?

Best regards,

--


Jesús Domínguez Colino

Consultor Senior







Pº de la Castellana, 182 - 10ª planta

28046 - Madrid

Tel.: +34 913531564

Fax: +34 913596179

www.mtp.es <www.mtp.es>
The administrator has disabled public write access.

List restriction combined with length 18 Jul 2008 09:27 #7382

  • Jes
  • Jes's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
Hi Giorgy,

Since the list is always more restrictive, I don't see the harm of not
permitting the combination list + length. If you permit it, it will end
up in runtime errors.

Best regards,
Jes
The administrator has disabled public write access.

List restriction combined with length 18 Jul 2008 09:43 #7383

Hi Jesús,

The example says there shall be no runtime error just because the type is empty (of course, the user shall be aware what value it can assign to an instance of the type - but this is true for all types).

But think about the following example:
type charstring Broader ("a", "ab", "abc", "abcd");
type Broader Narrower length (2..3);

In Narrower both the list and lenght restriction applies but is a valid use case.

BR, Gyorgy


________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Jesús Domínguez Colino
Sent: Friday, 18 July, 2008 11:28 AM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: List restriction combined with length


Hi Giorgy,

Since the list is always more restrictive, I don't see the harm of not permitting the combination list + length. If you permit it, it will end up in runtime errors.

Best regards,
Jesús

György Réthy escribió:

Hi,

No it makes not, at least not in this form (it may make sense to add
an empty record for example as a placeholder for future protocol extensions - some encodings are able to skip the unknown elements added later).

The example says that the language do not want to constrain such use
artificially, even if it is generally considered to be useless.

BR, Gyorgy


________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active
members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Jesús Domínguez Colino
Sent: Thursday, 17 July, 2008 3:16 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: List restriction combined with length


Hi all,

Looking in the Core Language document (6.1.2.5.2 section) I
find this example:

type charstring MyCharStr10 ("gr", "xyz") length (4);
// contains no value (empty type).

Does it make any sense to have an empty type? Is there a
historical reason?

Best regards,

--


Jesús Domínguez Colino

Consultor Senior







Pº de la Castellana, 182 - 10ª planta

28046 - Madrid

Tel.: +34 913531564

Fax: +34 913596179

www.mtp.es <www.mtp.es>



--


Jesús Domínguez Colino

Consultor Senior







Pº de la Castellana, 182 - 10ª planta

28046 - Madrid

Tel.: +34 913531564

Fax: +34 913596179

www.mtp.es <www.mtp.es>
The administrator has disabled public write access.

List restriction combined with length 18 Jul 2008 10:12 #7384

  • Jes
  • Jes's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
Thanks Gyorgy! I understand it better now. Still, I think a compiler
should be able to give no less than a warning if such a situation
(empty type) takes place

Regards,
Jes
The administrator has disabled public write access.

List restriction combined with length 18 Jul 2008 10:20 #7385

Hi Jesús,

I agree it is useful if a compiler is able to give a warning in such cases. This is, of course, above the scope of a (the) standard.

BR, Gyorgy



________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Jesús Domínguez Colino
Sent: Friday, 18 July, 2008 12:12 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: List restriction combined with length


Thanks Gyorgy! I understand it better now. Still, I think a compiler should be able to give no less than a warning if such a situation (empty type) takes place

Regards,
Jesús

György Réthy escribió:

Hi Jesús,

The example says there shall be no runtime error just because the
type is empty (of course, the user shall be aware what value it can assign to an instance of the type - but this is true for all types).

But think about the following example:
type charstring Broader ("a", "ab", "abc", "abcd");
type Broader Narrower length (2..3);

In Narrower both the list and lenght restriction applies but is a valid use case.

BR, Gyorgy


________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active
members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Jesús Domínguez Colino
Sent: Friday, 18 July, 2008 11:28 AM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: List restriction combined with length


Hi Giorgy,

Since the list is always more restrictive, I don't see the
harm of not permitting the combination list + length. If you permit it, it will end up in runtime errors.

Best regards,
Jesús

György Réthy escribió:

Hi,

No it makes not, at least not in this form (it may make
sense to add an empty record for example as a placeholder for future protocol extensions - some encodings are able to skip the unknown elements added later).

The example says that the language do not want to
constrain such use artificially, even if it is generally considered to be useless.

BR, Gyorgy


________________________________
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin