ID:271246
 
what is the differents between
var/Players=list()
and
var/list/Players=list()
I'm pretty sure that the difference is that, if I'm wrong, then someone will surely correct me :
var/players=list()

sets the variable players to being in list form.


var/list/players=list()

creates a new list with the name, players.

Both have the same effect.

var/Players is not typecasted, while var/list/Players is.

var/A=list()
var/list/B=list()

world<<A.len //gives a compile error
world<<B.len //works as expected


Only in rare cases should you not typecast it, such as when you don't know what the value is. In the case above you could then use the length() proc, or you could use the : operator.
In response to Android Data
so which one contribute to the ERROR: maximum number of lists exceeded, casue i only want the lsit be called, when need instead on anything having a list
In response to Sayian Hunter
Pay attention. Both will create a list object, just one method typecasts the variable (typecasting affects compiling only, and is mainly for error checking) and one doesn't.
What creates a list object, is obviously the new() proc, or the shorthand list() proc, mostly used with the assignation operator ('=') to assign the list reference to the variable.
//These lines are equivalent, typecast the var as a list, and create and assign a list object to the variable L:
var/list/L = new()
var/list/L = list()


//These lines are equivalent, typecast the var as a list, but don't create a list object.
var/list/L
var/list/L = null