Direct access to ARGV #5

bb opened this Issue Jun 18, 2010 · 0 comments

1 participant

bb commented Jun 18, 2010

It is currently possible to access the command line arguments when writing a Duby script like this

class MyClass
  def self.main(args:String[])
     puts args

But it's not possible to use ARGV like it is in Ruby. This script will currently fail:

puts ARGV

It would be cool if ARGV would be available outside explicitly declared classes.
In the generated java code, args is available at the moment, but at compile time, the type of args cannot be inferred. I guess it could be enough to globally declare args as String[] but I prefer the usage of ARGV outside of an explicit main method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment