Post Reply 
newRPL: Simplified matrices proposal
06-08-2015, 06:16 PM (This post was last modified: 06-08-2015 07:12 PM by Claudio L..)
Post: #12
RE: newRPL: Simplified matrices proposal
(06-08-2015 04:39 PM)3298 Wrote:  the SIZE command behaves differently on matrices and vectors: on matrices it obviously returns both dimensions as a list with two elements, on a vector or any other array it returns a list with just a single element.

You are right, SIZE would change. I can't say it would break, because it was probably already broken...

[ 1 2 3 ] SIZE --> { 3 }
[[ 1 2 3 ]] SIZE --> { 1 3 }
{ 1 2 3 } SIZE --> 3
{{ 1 2 3 }} SIZE --> 1

So it works for numeric vectors, but for symbolic vectors it returns a number, not a list. For symbolic matrices doesn't even give a hint.
So now the question becomes: Is this a behavior worth keeping?

EDIT: I should clarify the first 2 examples also apply to the MATRIX symbolic matrices, so it's consistent as long as you don't use lists (49g only, not backwards compatible).
So it looks like vectors should be a separate type to avoid compat. issues. I can't see a way around this one.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: newRPL: Simplified matrices proposal - Claudio L. - 06-08-2015 06:16 PM

User(s) browsing this thread: 1 Guest(s)