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

TOPIC: First-class status of "not-used"

First-class status of "not-used" 20 Jul 2008 16:22 #7386

Is the "-" for "unchanged" only permissible in field-value or array
expressions on the right-hand side of assignments? I only see this kind
of stuff in the standard document:

foo := { ..., -, ...}

but never

function f(in MyRecord src) ...

... f( { ..., -, ...} ) ...

If the latter is permitted, what would the semantics of this:

var MyRecord dst = { ..., 42, ...};
dst := src;

be, assuming it's in the body of f, and the 42 corresponds to the same
field as the "-"? I.e. is the field in dst unchanged or undefined?

--
Regards,
Mike
The administrator has disabled public write access.

First-class status of "not-used" 21 Jul 2008 06:25 #7387

Dear Mike,

None of them, will be the value of the corresponding field of src (but not as in your example, see below).

The dash in the semantic meaning "no change" is allowed in value list notations where incomplete definitions are allowed. But this is not something like a "drag along" property, the dash has effect on the very assignment only it is used in, like in your foo example. Whatever was in that field/element of foo before the assignment, it remains the same after the assignment (even if the field/element was unbound).

Your second example is incorrect, as in parameters shall always be fully initialized. But, apart from this, the value of the field initialized to 42 in dst will get the value of the corresponding field in src; in the assignment dst := src; all actual values of all fields of src are assigned to the corresponding fields of dst, no matter how the actual parameter passed to src got those values.

BR, Gyorgy

>
Original Message
> 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 Michael Sperber
> Sent: Sunday, 20 July, 2008 6:22 PM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: First-class status of "not-used"
>
> Is the "-" for "unchanged" only permissible in field-value or
> array expressions on the right-hand side of assignments? I
> only see this kind of stuff in the standard document:
>
> foo := { ..., -, ...}
>
> but never
>
> function f(in MyRecord src) ...
>
> ... f( { ..., -, ...} ) ...
>
> If the latter is permitted, what would the semantics of this:
>
> var MyRecord dst = { ..., 42, ...};
> dst := src;
>
> be, assuming it's in the body of f, and the 42 corresponds to
> the same field as the "-"? I.e. is the field in dst
> unchanged or undefined?
>
> --
> Regards,
> Mike
>
The administrator has disabled public write access.

First-class status of "not-used" 22 Jul 2008 07:50 #7388

Thanks for the prompt answer!

György Réthy <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:

> The dash in the semantic meaning "no change" is allowed in value list
> notations where incomplete definitions are allowed. But this is not
> something like a "drag along" property, the dash has effect on the
> very assignment only it is used in, like in your foo example. Whatever
> was in that field/element of foo before the assignment, it remains the
> same after the assignment (even if the field/element was unbound).

Is this spelled out in the standard somewhere?

--
Regards,
Mike
The administrator has disabled public write access.

First-class status of "not-used" 22 Jul 2008 08:11 #7389

Hi Mike,

it can be invented from clauses 6.2 and 6.3; mainly from the examples :(
the description in 6.2 is incomplete as it is relevant to the intialization only; I wrote a CR to extend the text to other cases as well.

BR, Gyorgy

>
Original Message
> 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 Michael Sperber
> Sent: Tuesday, 22 July, 2008 9:50 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: First-class status of "not-used"
>
> Thanks for the prompt answer!
>
> György Réthy <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:
>
> > The dash in the semantic meaning "no change" is allowed in
> value list
> > notations where incomplete definitions are allowed. But this is not
> > something like a "drag along" property, the dash has effect on the
> > very assignment only it is used in, like in your foo
> example. Whatever
> > was in that field/element of foo before the assignment, it
> remains the
> > same after the assignment (even if the field/element was unbound).
>
> Is this spelled out in the standard somewhere?
>
> --
> Regards,
> Mike
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin