Subject: [sv-ec] EXT11 - Dynamic Queues
From: Ryan, Ray (Ray_Ryan@mentorg.com)
Date: Mon Oct 20 2003 - 10:42:07 PDT
Below are some comments regarding ext11 - Dynamic Queues
4.14:
-----
Should explicitly state that queues are restricted to a single dimension.
4.14.4 insert()
---------------
In the following example:
int q[$] = { 2,4,8 };
q.insert(10,-1);
what is the size of 'q' after the insert? Using the definition
Q.insert(i,e) is equivalent to Q={Q[0:i-1],e,Q[i,$]}, then
'q' is:
{ q[0:9],-1,q[10:2] }
which is:
{ {2,4,8},-1,{}}
yielding:
{ 2,4,8,-1 }
but I'd expect { 2,4,8,0,0,0,0,0,0,0,-1 }
4.15.1 Array Locator Methods
----------------------------
Can the 'with' expression have side effects (e.g. include a function
call that updates globals, does IO).
If so, the order of evaluation of the elements of the array needs to
be specified.
In the definition of the max() method, the word 'minimum' should be
corrected to 'maximum'
4.15.2 Array ordering methods
-----------------------------
To be consistent with my past comments, I'll point out that the
'shuffle' method is not portable unless there is some specification
as to how the elements are randomized.
4.15.3 Array reduction methods
------------------------------
It might be useful to explicitly state the semantics of the 'with'
expression. EG. define sum as:
-- sum() returns the sum of all the array elements, or if a with
clause is specified, returns the sum of the values yielded by
evaluating the with expression for each of the array elements.
This is implied by the example, but wasn't otherwise obvious to me.
Assuming that the above defintion is correct, this requires that
the corresponding binary arithmetic or boolean operation is
defined for the type of the 'with' expression.
4.15.3 Iterator index querying
------------------------------
The dimension ordering for multi-dimension arrays, should also be
specified in 14.15.1.
This archive was generated by hypermail 2b28 : Mon Oct 20 2003 - 10:44:17 PDT