Subject: RE: SDL-News: Duration->Real?
From: Rick Reed (Rick.Reed#etsi.fr)
Date: Thu Oct 09 1997 - 14:13:14 GMT
The originator of this message is responsible for its content.
-----From Rick Reed <Rick.Reed#etsi.fr> to sdlnews -----
In reply to:
>>From: Yury Chernov <Yury.Chernov#ecitele.com>
>>To: "'SDL Discussion'" <sdlnews#sdl-forum.org>
>>Subject: SDL-news: Duration->Real?
>>Date: Thu, 9 Oct 1997 14:02:30 +-200
>>Is there an "elegant" way to convert a variable of type Duration to Real?
You cannot change the sort of a variable.
If you use Z.105 then you can have a variable with a CHOICE of sorts.
In this case the variable can be associated with different sorts of
values, but not two different sorts at the same time. You would need to
read the value associated with the variable and then re-assign it to the
variable after converting it to the other sort using an operator.
I assume what you really want to do is to recast the sort of a value
(not a variable).
DCL r Real, d Duration;
I assume that you want a casting operator such that:
NEWTYPE dummy /* sort not used! */
Real: Duration -> Real;
0.0 == Real(0.0);
/* this provides a fixed point, from which it can derived from
the axioms for given with Duration that
1.1 == Real(1.1) ... and so on */
so that you can then write
a) you may not consider this to be elegant, because of the need to
introduce a dummy NEWTYPE;
b) it is unlikely that any tool provides more than just a semantic
check, so you will have to add some (non-SDL) specification of the
casting operator for simulation or implementation.
-----End text from Rick Reed <Rick.Reed#etsi.fr> to sdlnews -----
For help, email "majordomo#sdl-forum.org" with the body of your email as:
or (iff this does not answer your question) email: owner-sdlnews#sdl-forum.org
This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:39 GMT