[BLACKBOX] Matrix slices - syntax
----boundary-LibPST-iamunique-849727456_-_-
Content-type: text/plain
Folks,
I don't understand this.
If I define a procedure that takes an ARRAY OF REAL and
pass it an row of a matrix then that works BUT if I specialize
the procedure to take an ARRAY 3 OF REAL and pass it a
row of a matrix ARRAY 3,3 OF REAL then the compiler complains.
TYPE
VDesc = ARRAY OF REAL;
V3Desc = ARRAY 3 OF REAL;
MDesc = ARRAY OF ARRAY OF REAL;
M3Desc = ARRAY 3,3 OF REAL;
PROCEDURE Q (IN v: VDesc); BEGIN END Q;
PROCEDURE Q3 (IN v: V3Desc); BEGIN END Q3;
PROCEDURE Test;
VAR m3: M3Desc;
BEGIN
Q(m3[0]); (* works *)
Q3(m3[0]) (* fails! incompatible assignment *)
END Test;
The "slice" m3[0], which is the first row of m3, is accepted by a routine
that accepts general non specific vectors but that same slice which
has length 3 is rejected by a routine that wants vectors of length 3.
Why?
I really don't understand the strong typing in this case.
-Doug Danforth
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
----boundary-LibPST-iamunique-849727456_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbWh0bWwxIFxkZWZmMHtcZm9udHRibA0Ke1xmMFxm
c3dpc3NcZmNoYXJzZXQwIEFyaWFsO30NCntcZjFcZm1vZGVybiBDb3VyaWVyIE5ldzt9DQp7XGYy
XGZuaWxcZmNoYXJzZXQyIFN5bWJvbDt9DQp7XGYzXGZtb2Rlcm5cZmNoYXJzZXQwIENvdXJpZXIg
TmV3O319DQp7XGNvbG9ydGJsXHJlZDBcZ3JlZW4wXGJsdWUwO1xyZWQwXGdyZWVuMFxibHVlMjU1
O1xyZWQyNTVcZ3JlZW4wXGJsdWUwO30NClx1YzFccGFyZFxwbGFpblxkZWZ0YWIzNjAgXGYwXGZz
MjQgDQp7XCpcaHRtbHRhZzI0MyA8I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