Menu ▾ ▴

#2127 Object~request: documentation and behaviour disagree since r12691

5.3.0
open
nobody
None
none
5
4 days ago
4 days ago
No

While adding the missing tests for [#1904] I noticed that the rexxref
description of request no longer matches what the interpreter does.
The docs say the class id is compared first, and the receiver returned
if it matches; since [r12691], request sends MAKEclassid first and only
falls back to the class id when there is no such method (the comment in
RexxObject::requestRexx says this is intentional).

One visible effect: a~request("ARRAY") on an Array used to return a
itself, and now returns the result of a~makeArray, a new array, which
for a sparse array is compacted:

a = .array~new(5); a[1] = 'x'; a[5] = 'y'
r = a~request("ARRAY")
say (r == a) r~size -- 5.0.0: 1 5 5.1.0 and later: 0 2

(makeArray itself has not changed: it returns a new, compacted array in
both versions.)

Related

Bugs: #1904
Commit: [r12691]

Discussion

Anonymous
Anonymous

Add attachments
Cancel