RE: [sv-ec] 5.15 Array manipulation methods - question

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Dec 01 2005 - 04:55:54 PST
Arturo,

I hope you don't object to my copying your reply to the entire list.

It seems you agree with Dave Rich on this.

However, I could say that this is not what the LRM implies.

And it does break the symmetry between find() and find_index().

It still would not be clear how it would work. I think it becomes
necessary to add details defining what types of methods and expressions
are legal in what cases.

For example, take the last 2 examples in 5.15.4:

int arr[]
int mem[9:0][9:0], mem2[9:0][9:0];
int q[$];
...
// find all items equal to their position (index)
q = arr.find with ( item == item.index );
// find all items in mem that are greater than corresponding item in
mem2
q = mem.find( x ) with ( x > mem2[x.index(1)][x.index(2)] );

Suppose you change find(x) to find_index(x). What does it do?
What kind of expression is legal in with()?

Or suppose arr is a multi-dimensional array. What does
"q = arr.find with ( item == item.index );"  do?

What about the find_first() method?

etc., ....

Shalom

>-----Original Message-----
>From: Arturo Salz [mailto:Arturo.Salz@synopsys.com]
>Sent: Thursday, December 01, 2005 12:29 AM
>To: Bresticker, Shalom
>Subject: RE: [sv-ec] 5.15 Array manipulation methods - question


>I agree with you that there is indeed a problem with find_index
>when
>applied to multidimensional arrays. I think that the solution
>to this
>quandary is to do:
>1) Restrict find_index to operate on a single dimension.
>2) Modify the find_index return type so that it returns a
>collection of
>indexes when applied to a multi-dimensional array. For example,
>an array
>of N indexes for an N-dimensional array.
>
>I think the second solution is heavy handed and complex so I'd
>favor
>(1).
Received on Thu Dec 1 04:56:13 2005

This archive was generated by hypermail 2.1.8 : Thu Dec 01 2005 - 04:57:42 PST