RE: [sv-bc] Question on ?: with "any" data type

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Tue Feb 07 2006 - 14:28:20 PST
I think it makes sense for an ambiguous conditional that includes
different sized expressions of type string, queue, or
dynamic/associative array to just return the default value. Hence, as
Gord suggests, if the length is different, the ? operator will yield an
empty string, empty queue, or empty array, respectively.

	Arturo

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Gordon Vreugdenhil
Sent: Tuesday, February 07, 2006 2:08 PM
To: Steven Sharp
Cc: sv-bc@eda.org
Subject: Re: [sv-bc] Question on ?: with "any" data type

<blush>

I don't know how I managed to miss 8.18 (which was the real
problem).  Sigh.

Sorry for wasting your time.


In looking at the 8.18 text, it seems that "equivalent type"
rules don't directly cover things like queues, etc.  However,
from 5.7 we have:
     A dynamic array can be assigned to a fixed-size array of an
     equivalent type if the size of the dynamic array dimension
     is the same as the length of the fixed-size array dimension.

So I think that for queues and dynamic arrays it might make sense
to treat the "same length" as a run-time check and having the
rest of the "equivalent type" rules be retained.  I agree that
the associative array case is very odd here.

Gord.

Steven Sharp wrote:
[...]
> 
> Things seem really fuzzy for objects that can have differing numbers
> of elements, such as queues and associative arrays.  My best guess is
> that combining a queue containing 5 elements with one containing 8
> elements would result in an 8-element queue where the last 3 elements
> were all the default initialization value (since those elements did
> not match in both).  But you could instead get a 5-element queue,
> which behaves similarly in some ways, giving you back the default
> initialization value if you try to read the extra 3 elements.  Similar
> possibilities exist for associative arrays.
> 
> It's all very messy.
> 
> Steven Sharp
> sharp@cadence.com
> 

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com
Received on Tue Feb 7 14:28:29 2006

This archive was generated by hypermail 2.1.8 : Tue Feb 07 2006 - 14:29:02 PST