ID:2054874
 
(See the best response by Lummox JR.)
How would you go about making a nested list? I'm looking to have a world list of guild names that can have values added or removed at runtime and where each name has a list of keys attached to it that can also be added to or removed from at runtime.
Best response
I would think making each guild a datum would be preferable on a lot of levels, but there are lots of ways to make nested lists.

The simplest:

var/list/guilds = new

proc/AddToGuild(guildname, key)
var/list/L = guilds[guildname]
if(!L)
L = new
guilds[guildname] = L
L[key] = null

proc/RemoveFromGuild(guildname, key)
var/list/L = guilds[guildname]
if(!L) return
L -= key
if(!L.len) guilds -= guildname

thnx for the idea, i think ill try using datums for this