You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a vector is created implicitly by assigning a value to its first position, the .append() member procedure doesn't work. However, it does work if the vector is created using v().
To Reproduce
# Case 1
> z[1] <- 1
> z
[ 1 ]
> z.append(2)
> z
[ 1 ]
# Case 2
> z <- v(1)
> z
[ 1 ]
> z.append(2)
> z
[ 1, 2 ]
Expected behavior
All member procedures should be available to all vectors, regardless of how they are created.
The text was updated successfully, but these errors were encountered:
jembrown
changed the title
.append() member procedure doesn't work if vector created implicitly[BUG]
[BUG] .append() member procedure doesn't work if vector created implicitly
Mar 8, 2023
The issue is that in the first case there doesn't actually exist the vector in memory, only the elements of the vector z[1]. When you call 'z' it creates a temporary vector, so you append to the temporary vector that then gets thrown away.
I see that this is confusing but I'm not super sure how easy that is to fix.
Ah, ok. I didn't realize that's how vectors were handled in the first case. Perhaps that's ok if (i) the .append() method doesn't appear when you call z.methods() and/or (ii) an error is displayed when trying to call .append() on a temporary vector?
Describe the bug
When a vector is created implicitly by assigning a value to its first position, the .append() member procedure doesn't work. However, it does work if the vector is created using v().
To Reproduce
Expected behavior
All member procedures should be available to all vectors, regardless of how they are created.
The text was updated successfully, but these errors were encountered: