var/obj/objList[]
obj/var/a
proc/HalfTotal()
. = 0
for(var/i = 0; i < objList.len>>1 ; i++)
. += objList[i].a
Currently you'd need to create an object reference and assign it to the object within the list at the specified index then on another line get the value from the reference. While in this case it doesn't save much but in a more complex data structure with nested objects with lists this would be a real life saver. The best part is not much needs to be added to support this syntax since you can already define a list with a type path like I did above but I think currently it is just ignored.
Would also be nice is a similiar thing could be done with proc return values though this would probably require a larger overhaul.
...
Actually quite a bit would need to be changed. The type path is for the list itself, but does not apply to the items inside. It'd still be important to define the list as a /list, too, because of the need to access list procs and vars. What you're asking is basically an equivalent of a template array class in C++, which isn't even really as easy as C++ makes it out to be.
Chalk the list thing up to the difference between lists and true arrays. Ultimately they're not the same thing, and will never be. A true array has a type, but in list languages (which are invariably loosely typed like BYOND), any item at all may be added to a list. To try to force a list to be typed is basically to try to totally redefine the language to use arrays instead of lists.
They'd both require overhauls. I suspect however that setting a return type for a proc would be easier by several orders of magnitude. Syntax and most other aspects would be nothing compared to typing a list. The list thing is basically impossible in almost any language that uses them, due to severely conflicting design.
However, both would break a lot of existing code, as the : operator is used for both proc/var access and the ternary ?: operator. (It's also used for paths!) When the : operator is encountered following a closing bracket or parenthesis, BYOND knows it will not be used for proc/var access, and treats it automatically as something different. The only way to avoid this would be to disallow use of the : operator in those scenarios, and only allow the . operator instead. Granted there's something to be said for that.
Lummox JR