OK, I think I see what you mean. We would need $typeof()
to get the type of an expression that does not evaluate
to a type, so that
$typeof(3.14159) == real
-- Brad
p.s. (3.14159 == real) would be a semantic error.
-----Original Message-----
From: Rich, Dave [mailto:Dave_Rich@mentorg.com]
Sent: Wednesday, November 24, 2004 1:38 PM
To: Brad.Pierce@synopsys.COM; sv-bc@eda.org
Subject: RE: [sv-bc] A question regarding the proposal for issue # 91
Brad,
You would still need $typeof because P could be an instance of a type,
and not a type itself.
Dave
-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Brad
Pierce
Sent: Wednesday, November 24, 2004 1:29 PM
To: sv-bc@eda.org
Subject: Re: [sv-bc] A question regarding the proposal for issue # 91
In http://www.eda.org/sv-bc/hm/2040.html Dave suggests
adding simple_type to constant_primary. I agree that
it makes sense to consider types as just another kind
of value.
If so, however, then we should also eliminate $typeof().
Dave gives the example of
if ($typeof(P) == real) // not legal now, but would become so
...
But if simple_type were a constant_primary, then this could
be written more simply (and naturally) as
if (P == real)
...
Keeping $typeof() would be like having a function $valueof()
that could be applied to expressions.
-- Brad
Received on Wed Nov 24 14:04:02 2004
This archive was generated by hypermail 2.1.8 : Wed Nov 24 2004 - 14:04:06 PST