M2 icon indicating copy to clipboard operation
M2 copied to clipboard

Allow Lists or Sequences of specific types as typical value type

Open mahrud opened this issue 5 years ago • 1 comments
trafficstars

Returning a sequence of types might make sense, because the documentation already allows multiple outputs to be listed, i.e., the usage can be of the form (x,y) = foo(), and you can have separate entries in Outputs for x and y. And some functions take advantage of this, including flattenRing.

Originally posted by @DanGrayson in https://github.com/Macaulay2/M2/issues/448#issuecomment-654439212

mahrud avatar Jul 07 '20 06:07 mahrud

Sounds good to me. Maybe (X,Y,Z) could mean a sequence of length 3 whose elements are of types X, Y, and Z, respectively, but {X} could mean a list of any length, all of whose elements are of type X.

DanGrayson avatar Dec 13 '20 17:12 DanGrayson