var/list/L=new(1,2,3,4);
also which is faster
mob/verb/A()
var/list/L=new(1,2,3,4);
var/x=L[1]+L[2]+L[3]+L[4]
or
Storage
var/a,b,c,d
New(A,B,C,D)
a=A,b=B,c=C,d=D
mob/verb/A()
var/Storage/L=new(1,2,3,4);
var/x=L[1]+L[2]+L[3]+L[4]
I mean use a datum or a list as storage for 4 integer numbers? I'm gonna pass them through procs a lot of times so I need the fastest way to pass the data and also extract the vars inside them.
The difference is that list(x, y, z) is a list initialized with x, y, and z inside, but new/list(x, y, z) is a 3D list that contains x lists that contain y lists that contain z nulls.
A list is always going to be faster to initialize than an equivalent datum, but a datum is often more appropriate because of object oriented programming.
You might not have to always create a new list or datum, though, if you use object pooling.