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

TOPIC:

what does it imply by saying that optional fields shall be omitted using ... 02 Jun 2003 07:56 #6488

In einer eMail vom 6/2/03 9:45:44 AM W. Europe Daylight Time schreibt
This email address is being protected from spambots. You need JavaScript enabled to view it.:


> Hi guys,
>
> I think I need to correct you here, Clause.

I might be getting rusty :-). By all means, if I've fibbed, do correct me.

The 'omit' symbol may well be used also outside templates, e.g., to marke
fields in a value
> as being omitted.

Would this not also imply that all other matching mechanisms can be used
outside of
templates? or is omit a special case?


Example
>
>
> type record MyType {
> integer x optional;
> integer y optional
> }
>
> var MyType r1 := { omit, omit };
> var MyType r2 := { -, - }; // value list notations
> var MyType r3 := { }; // assignment list notation, empty list
>
> After this, r2 and r3 have the same structure, but this structure is
> different from the structur of r1. r1 is a fully defined value (whith two
omitted
> fileds), which can, e.g., be used in a send statement. r2 and r3 have two
> _undefined_ (not omitted) fields, and using r2 or r3 in a send statement will
> cause a run time error.
>

> Also, while
>
> if (r1.x == omit) { ... }
>
> will work nicely,
>
> if (r2.x == omit) { ... }
>
> will cause a run time error due to a read access to an undefined field.
>
> So, in other words, and to come back to the original question: the only way
> to set an optional field to the 'omitted' state, the omit keywords must be
> used. Of course, it can also be used in templates to match optional fields
that
> have been omitted.
>
> BR
>
> Stephan Tobies
>
>



Claude Desroches email: This email address is being protected from spambots. You need JavaScript enabled to view it.
Solonplatz 3 phone: +49 30 9606 7985
13088 Berlin fax: +49 30 9606 7987
Germany

Please Log in to join the conversation.

what does it imply by saying that optional fields shall be omitted using ... 04 Jun 2003 12:24 #6492

In einer eMail vom 6/2/03 10:34:50 AM W. Europe Daylight Time schreibt
This email address is being protected from spambots. You need JavaScript enabled to view it.:


>
>
> Hi Claude,

Hi Stephan,

>
> (sorry about the Freudian mispelling in the earlier mail!).
>

No problem! :-).

> 'omit' is not a matching expression, it is a value (see BNF clause 434). So
> there is not problem with using omit inside values and templates, just like
> 42 or "Some funny string" can be used in templates.
>
Thanks for the clarification, I had assumed, without referring to the BNF
that omit
was a matching mechanism, as in TTCN-2. Would this also apply to '-'.


> For matching symbols like '*' or '?', the story is of course different.
> They are not values and may only appear inside templates.
>
As I had assumed.

Thanks for the input once more.

Cheers,


Claude.



> BR
>
> Stephan Tobies
>



Claude Desroches email: This email address is being protected from spambots. You need JavaScript enabled to view it.
Solonplatz 3 phone: +49 30 9606 7985
13088 Berlin fax: +49 30 9606 7987
Germany

Please Log in to join the conversation.

  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin