Byond barely considers global.vars a list, (the same seems to be true for world.vars). basically for (var/thing) works on it, and [] works on it, thats it. For reference, everything here works properly on datum's vars list.
Compile time it has no list vars
/client/verb/checkglob()
world << "[global.vars.len]"
world << "[global.vars.Join(", ")]"
loading 512testing.dme
512testing.dm:2:error: global.vars.len: undefined var
512testing.dm:3:error: global.vars.Join: undefined proc
512testing.dmb - 2 errors, 0 warnings (12/2/17 1:30 pm)
The proc ways of doing the same thing flat out don't work
/client/verb/checkglob()
world << "[length(global.vars)]"
world << "[istype(global.vars, /list)]"
world << "[jointext(global.vars, ", ")]"
runtime error: bad text or out of bounds
proc name: checkglob (/client/verb/checkglob)
source file: 512testing.dm,4
usr: Guest-755797302 (/mob)
src: Guest-755797302 (/client)
usr.loc: null
call stack:
Guest-755797302 (/client): checkglob()
0
0
Here's a fun one:
/client/verb/checkglob()
var/list/L = global.vars
world << L.len
Guess what this will do!
.
.
.
.
.
Lummox, I think you might already know what this is going to say, because here is when I realized what you did to make global.vars work (midway thru typing this).
runtime error: Global var len does not exist.
proc name: checkglob (/client/verb/checkglob)
source file: 512testing.dm,3
usr: Guest-755797302 (/mob)
src: Guest-755797302 (/client)
usr.loc: null
call stack:
Guest-755797302 (/client): checkglob()
To anybody who missed it, global.vars is just a reference to global to make it work as a list, lummox just implemented a [] operator overload on it. indeed you can do global.vars:someglobalvar and it will work.
This might not be easily fixable since it really shows a shortcoming of the [] operator overload, there is no way to get a length. (nor is there a way to check that an [] operation would be valid on a thing)