Dave, You refer to "queue and dynamic array concatenation". However, the LRM says, "the source of an assignment can be a complex expression involving array slices or concatenations". This implies it applies to all types of arrays, not just queues and dynamic arrays. Please clarify. Thanks, Shalom >-----Original Message----- >From: Rich, Dave [mailto:Dave_Rich@mentor.com] >Sent: Thursday, November 10, 2005 6:40 PM >To: Bresticker, Shalom; sv-ec@eda.org >Subject: RE: [sv-ec] 5.7 example question > >Shalom, > >There were lots of attempts to remove overloading of the >concatenation >braces {}. Some succeeded (assignment patterns now have to be >preceded >with a ' mark}, some didn't (queue and dynamic array >concatenation). > >When you do a queue index operation like > >q = {q[0:$],n}; > >or > >q = {q[0:pos],n,q[pos:$]); > >The queue dimension is split into its individual elements, and >then >recombined as part of the concatenation. > >This same principal can be applied to dynamic array dimensions. > >Dave > > > >> -----Original Message----- >> From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On >Behalf Of >> Bresticker, Shalom >> Sent: Wednesday, November 09, 2005 11:25 PM >> To: sv-ec@eda.org >> Subject: [sv-ec] 5.7 example question >> >> Hi, >> >> What do you say about the last example in 5.7 ? >> >> QUOTE: >> Similarly, the source of an assignment can be a complex >expression >> involving array slices or concatenations. For >> example: >> >> string d[1:5] = '{ "a", "b", "c", "d", "e" }; >> string p[]; >> p = { d[1:3], "hello", d[4:5] }; >> >> The preceding example creates the dynamic array p with >contents: "a", >> "b", "c", "hello", "d", "e". >> :ENDQUOTE >> >> Is the assignment to p in a legal form? >> >> If so, why? >> If not, how should it be done? >> >> I got the following response from Brad Pierce: >> >> "I think the committees agreed to "punt" on this issue, >because no one >> provided a detailed semantics for how it was supposed to >work, and no >> entity considered the issue important enough to vote 'no' >over it. >> >> As far as I know, there is no other way to get the splicing >behavior >of >> that example. Without it, you would need to write >> >> p = '{ d[1], d[2], d[3], "hello", d[4], d[5] }; >> >> But that methodology breaks down if the indices are >parameterized >> instead of simple literals. In that case, the only >alternative is to >> use two for loops." >> >> Thanks, >> Shalom >>Received on Sun Nov 13 23:34:42 2005
This archive was generated by hypermail 2.1.8 : Sun Nov 13 2005 - 23:34:59 PST