Bug in System getOptions?

View: New views
11 Messages — Rating Filter:   Alert me  

Bug in System getOptions?

by Michael T. Richter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...

 

signature.asc (196 bytes) Download Attachment

Re: Bug in System getOptions?

by Jonathan Wright-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Michael,

You'll need to track down the implementation of System getOptions. My guess
is it is somewhere in the vm/_ioCode directory. The bug in getOptions has
probably been introduced by other code changes. Possibly to do with ifNil
calls.

Jonathan.

On 2/21/06, 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@...
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQBD+vHcLqyWkKVQ54QRAsl4AJ0YT4+q4pvZxjjcfl993SZhFVmzDQCfSJI+
> TaDRv5KI3qhM+nnmhnmfGEU=
> =hD24
> -----END PGP SIGNATURE-----
>
>
>

Re: Bug in System getOptions?

by Jeremy Tregunna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 21-Feb-06, at 5:27 PM, Quag wrote:

> Hi Michael,
>
> You'll need to track down the implementation of System getOptions.  
> My guess is it is somewhere in the vm/_ioCode directory. The bug in  
> getOptions has probably been introduced by other code changes.  
> Possibly to do with ifNil calls.

Indeed it has; this problem i thoroughly tested when I wrote that  
code. I will have a look at what the problem could possibly be tomorrow.

> Jonathan.

--
Jeremy Tregunna
jtregunna@...

"If you round off the fractions, embedded systems consume 100% of the  
worldwide production of microprocessors." -- Jim Turley



Re: Bug in System getOptions?

by Michael T. Richter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2006-21-02 at 21:54 -0500, Jeremy Tregunna wrote:

> > You'll need to track down the implementation of System getOptions.
> > My guess is it is somewhere in the vm/_ioCode directory. The bug in
> > getOptions has probably been introduced by other code changes.
> > Possibly to do with ifNil calls.
> >


> Indeed it has; this problem i thoroughly tested when I wrote that
> code. I will have a look at what the problem could possibly be
> tomorrow.

Thanks, Jeremy.  I took a peek, but am not yet fluent enough in The Io
Way <tm> to see what's going on.


--
Michael T. Richter
Email: ttmrichter@..., mtr1966@...
MSN: ttmrichter@..., mtr1966@...; YIM:
michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber:
mtr1966@...

 

signature.asc (196 bytes) Download Attachment

Re: Bug in System getOptions?

by Jeremy Tregunna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 21-Feb-06, at 10:00 PM, Michael T. Richter wrote:

> On Tue, 2006-21-02 at 21:54 -0500, Jeremy Tregunna wrote:
>
>>> You'll need to track down the implementation of System  
>>> getOptions. My guess is it is somewhere in the vm/_ioCode  
>>> directory. The bug in getOptions has probably been introduced by  
>>> other code changes. Possibly to do with ifNil calls.
>
>> Indeed it has; this problem i thoroughly tested when I wrote that  
>> code. I will have a look at what the problem could possibly be  
>> tomorrow.
>
> Thanks, Jeremy.  I took a peek, but am not yet fluent enough in The  
> Io Way <tm> to see what's going on.

I make no guarantees that I do things the "Io Way" as I'm sure folks  
like Quag can testify too after seeing some of my code. =]

> Michael T. Richter

--
Jeremy Tregunna
jtregunna@...

"If you round off the fractions, embedded systems consume 100% of the  
worldwide production of microprocessors." -- Jim Turley



Re: Bug in System getOptions?

by Jonathan Wright-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2/22/06, Jeremy Tregunna <jtregunna@...> wrote:
>
>
> I make no guarantees that I do things the "Io Way" as I'm sure folks like
> Quag can testify too after seeing some of my code. =]
>

I get the feeling I'm being made out to be an Io Way nazi.

Jonathan.

Re: Bug in System getOptions?

by Jeremy Tregunna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 21-Feb-06, at 10:43 PM, Quag wrote:

> On 2/22/06, Jeremy Tregunna <jtregunna@...> wrote:
>
> I make no guarantees that I do things the "Io Way" as I'm sure  
> folks like Quag can testify too after seeing some of my code. =]
>
> I get the feeling I'm being made out to be an Io Way nazi.

Not my intention; didn't mean to imply that, sorry. Was merely  
referring that most of the Io code I write could use at least a few  
passes of refactoring before it looks like most other Io code.

> Jonathan.

--
Jeremy Tregunna
jtregunna@...

"If you round off the fractions, embedded systems consume 100% of the  
worldwide production of microprocessors." -- Jim Turley



Re: Bug in System getOptions?

by Michael T. Richter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2006-22-02 at 00:02 -0500, Jeremy Tregunna wrote:

> >         I make no guarantees that I do things the "Io Way" as I'm
> >         sure folks like Quag can testify too after seeing some of my
> >         code. =]


> > I get the feeling I'm being made out to be an Io Way nazi.


>
> Not my intention; didn't mean to imply that, sorry. Was merely
> referring that most of the Io code I write could use at least a few
> passes of refactoring before it looks like most other Io code.

Quag, be proud of the title.  Every language needs a "whip" to get
newbies into shape in "rightthink".  The alternative is a kitchen-sink
language like Ada, Perl, PL/I, et al.

--
Michael T. Richter
Email: ttmrichter@..., mtr1966@...
MSN: ttmrichter@..., mtr1966@...; YIM:
michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber:
mtr1966@...

 

signature.asc (196 bytes) Download Attachment

Re: Bug in System getOptions?

by Jonathan Wright-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2/22/06, Jeremy Tregunna <jtregunna@...> wrote:

>
>
> On 21-Feb-06, at 10:43 PM, Quag wrote:
>
> On 2/22/06, Jeremy Tregunna <jtregunna@...> wrote:
> >
> >
> > I make no guarantees that I do things the "Io Way" as I'm sure folks
> > like Quag can testify too after seeing some of my code. =]
> >
>
> I get the feeling I'm being made out to be an Io Way nazi.
>
>
> Not my intention; didn't mean to imply that, sorry. Was merely referring
> that most of the Io code I write could use at least a few passes of
> refactoring before it looks like most other Io code.
>

Sorry. Now I'm the one being misunderstood. I don't have a problem being an
Io Way nazi. :)

Jonathan.

Re: Bug in System getOptions?

by Jeremy Tregunna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry it took so long to reply back, I completely forgot about this.  
Anyway, I've fixed the problem and made the change available in my  
darcs repo located at: http://repos.blurgle.ca:81/darcs/io and  
submitted it to steve for addition in his repo. So if you need this  
right away, feel free to fetch it from my repo using:

darcs pull http://repos.blurgle.ca:81/darcs/io

Note that the patch you want is number 3, you can safely ignore the  
first two.

On 21-Feb-06, at 5:56 AM, Michael T. Richter 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@...
> !DSPAM:43faf20f519718734732295!


--
Jeremy Tregunna
jtregunna@...

"If you round off the fractions, embedded systems consume 100% of the  
worldwide production of microprocessors." -- Jim Turley



Re: Bug in System getOptions?

by audrencezar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To Try change:
-------------------------------------
options := System getOptions(args)
-------------------------------------
for:
-------------------------------------
options := System getOptions(System args)
-------------------------------------
It is ok for me.




--- In iolanguage@..., "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@...
>


LightInTheBox - Buy quality products at wholesale price