SpacemanDMM icon indicating copy to clipboard operation
SpacemanDMM copied to clipboard

[Feature Request] Check lists for extra elements from extra commas

Open martinlyra opened this issue 4 years ago • 0 comments

I tested this code with MoMMIv8 at coderbus Discord

/proc/print(list/val)
  world.log << val.len
/proc/main()
  var/list/l = list()
  print(l)
  print(list(,))
  print(list(,,,))

  print(list(1,2))
  print(list(1,2,))
  print(list(1,2,,))

and got the following output:

Thu Sep  2 00:34:14 2021
World opened on network port 47709.
Welcome BYOND! (5.0 Beta Version 514.1545)
0
1
3
2
2
3
The BYOND hub reports that port 47709 is not reachable.

For some codebases it is a problem that is extremely hard to find and is a source of behaviour oddities. If not a code quality smell at best.

martinlyra avatar Sep 19 '21 10:09 martinlyra