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