ID:2281762
 
(See the best response by Kaiochao.)
Code:
TurnEng
var/list/master[1]
New()
..()
Populate()
proc/Populate()
master[1]=new() //Master-list of mobs in world
for(var/mob/m1 in world)
master.Add(m1)
QuickSort(master,/proc/sort_turn) //sorted by their speed
world<<"Testing:"
world<<master[2]


Problem description:

For some reason, I can't access any objects in my list by their index. As a test run, I'm just trying to pull the second mob in the list, but all I get returned is "/list".

any help for an extremely rusty guy trying to dip my feet back in?
Best response
Some syntax clarifications:
// This declares a list-typed variable
// and initializes it with initial length == 1.
var/list/master[1]

// This accesses the 2nd item in the list.
// (you did this correctly)
master[2]

// This sets the first slot of the list to a new instance
// of the declared type of the variable (/list).
// (this probably isn't what you wanted to do)
master[1] = new

// This initializes a variable according to its declared type
// with default constructor arguments.
// (this is what you probably wanted)
master = new
Whelp, thank you!!