Loading ...
Sorry, an error occurred while loading the content.

Re: Bug in System getOptions?

Expand Messages
  • audrencezar
    ... options := System getOptions(args) ... options := System getOptions(System args) ... It is ok for me.
    Message 1 of 11 , Jun 1, 2008
    View Source
    • 0 Attachment
      To Try change:
      -------------------------------------
      options := System getOptions(args)
      -------------------------------------
      for:
      -------------------------------------
      options := System getOptions(System args)
      -------------------------------------
      It is ok for me.




      --- In iolanguage@yahoogroups.com, "Michael T. Richter"
      <ttmrichter@...> wrote:
      >
      > I have this script whose contents comes straight from the web page:
      >
      > -----8<-----
      > #!/usr/local/bin/io
      > options := System getOptions(args)
      > options foreach(k, v,
      > if(v type == List type,
      > v foreach(i, j, writeln("Got unnamed argument with value: " .. j))
      > continue
      > )
      > writeln("Got option: " .. k .. " with value: " .. v)
      > )
      > -----8<-----
      >
      > When I execute this script, here's what I get:
      >
      > -----8<-----
      > michael@isolde:~/Io/IoSH$ ./test.io
      >
      > Exception: argument 0 to method 'atPut' must be a Sequence, not a
      > 'Object'
      >
      > Coroutine_0x821eb90
      > -------------------
      > atPut System.io line 42
      > Object getOptions test.io line 2
      > Coroutine setResult A3_Exception.io line 67
      > Coroutine setResult A3_Exception.io line 67
      > Coroutine main [unlabeled] line 0
      >
      > michael@isolde:~/Io/IoSH$
      > -----8<-----
      >
      > Even if I comment out the whole "foreach" statement I get the same
      > thing. It really doesn't like getOptions. However, if I do it
      > manually:
      > -----8<-----
      > michael@isolde:~/Io/IoSH$ io
      > Io 20060213
      > Io> options := System getOptions(args)
      >
      > ==> Map_0x81fe790:
      >
      > Io>
      > -----8<-----
      >
      > As you can see it works. I'm kind of stumped as to how to resolve this
      > issue (or, indeed, as to why it's happening). Any ideas?
      >
      > --
      > Michael T. Richter
      > Email: ttmrichter@..., mtr1966@...
      > MSN: ttmrichter@..., mtr1966@...; YIM:
      > michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber:
      > mtr1966@...
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.