The list you get back can be modified, but if you invoke the method again from somewhere else, you get a new list:
get commandLineArgs as List<of String>
return List<of String>(Environment.getCommandLineArgs)
I just always assign it to a local anyway and then pass it around if I need to. Something like:
class Program
def main
args = CobraCore.commandLineArgs
for arg in args, print arg
Foo().bar(args)
class Foo
def bar(args as IList<of String>)
pass
This also means that Foo().bar() can be reused in other ways because it takes an argument instead of using a global source. Also you can do this if you want to skip the program name:
args = CobraCore.commandLineArgs[1:]
HTH