Ilya Zakharevich on Fri, 01 Dec 2023 22:51:28 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: #matr~ vs ##matr (and: arity, questenian and !!)


On Sun, Nov 26, 2023 at 07:48:32PM -0800, Ilya Zakharevich wrote:
>   #mattr~   optimized in the compiler to (an equivalent to) (matsize(mattr))[1]

Thanks for implementing this!

>   ##object  return “the arity” of the object: 2/1/0 for matrices/vectors/scalars 
>   	    (and maybe -1 for the “tricky” cases, when/if an object may
>   	     be used as a scalar AND as a vector/matrix/etc.).

BTW, on backward compatibility:

  • introducing a new function NEW is not backward compatible, since
    some user may have used #NEW instead of 2.

  • ##EXPR is a very funny way to replace 1.

Hope this helps,
Ilya