[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Freaked out man!

Asfand Yar Qazi

11/11/2004 9:40:00 AM

Hi,

Its odd - if I place a comment at the end of a program I'm writing,
its ok. If I take out the comment, the program crashes?!

Any ideas why?

p.s. Its a game with lots of system access going on.

--
http://www.it-is-...
5 Answers

Asfand Yar Qazi

11/11/2004 9:44:00 AM

0

Asfand Yar Qazi wrote:
> Hi,
>
> Its odd - if I place a comment at the end of a program I'm writing, its
> ok. If I take out the comment, the program crashes?!
>
> Any ideas why?
>
> p.s. Its a game with lots of system access going on.
>

Basically, I'm doing something like this:

Game::new(:userdir => ".game_0.1",
:datadir => "data") do |game|
game.state_machine.add("1", DefaultState.new)
game.state_machine.add("2", AnotherState.new)
end

<crash at this point>


After executing the block, the game's initialise method goes straight
into the game loop. On exiting the loop (when the game quits)
deinitialisation is performed.

A crash occurs at the shown point.

But if I change the top line to:

g = Game::new(:userdir => ".game_0.1",
:datadir => "data") do |game|
....

Then its OK.

What's going on? Any ideas?


--
http://www.it-is-...

Nikolai Weibull

11/11/2004 10:36:00 AM

0

* Asfand Yar Qazi <see@message.body.com> [Nov 11, 2004 11:10]:
> Its odd - if I place a comment at the end of a program I'm writing,
> its ok. If I take out the comment, the program crashes?!

> Any ideas why?

Wow! Thanks for the lengthy description of the problem. We've got 10
people working 24/7 on this one.
nikolai

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


Carlos

11/11/2004 12:56:00 PM

0

[Asfand Yar Qazi <see@message.body.com>, 2004-11-11 10.38 CET]
> Hi,
>
> Its odd - if I place a comment at the end of a program I'm writing,
> its ok. If I take out the comment, the program crashes?!
>
> Any ideas why?

Maybe you recompiled ruby but forgot to recompile the extensions (?).

--


Brian Schröder

11/11/2004 1:09:00 PM

0

On Thu, 11 Nov 2004 18:38:29 +0900
Asfand Yar Qazi <see@message.body.com> wrote:

> Hi,
>
> Its odd - if I place a comment at the end of a program I'm writing,
> its ok. If I take out the comment, the program crashes?!
>
> Any ideas why?
>
> p.s. Its a game with lots of system access going on.
>
> --
> http://www.it-is-...
>

Please try to cut down your program to a minimal example, and post the minimal example here.

Regards,

Brian

--
Brian Schröder
http://www.brian-sch...



Asfand Yar Qazi

11/16/2004 3:58:00 PM

0

Brian Schröder wrote:
> On Thu, 11 Nov 2004 18:38:29 +0900
> Asfand Yar Qazi <see@message.body.com> wrote:
>
>
>>Hi,
>>
>>Its odd - if I place a comment at the end of a program I'm writing,
>>its ok. If I take out the comment, the program crashes?!
>>
>>Any ideas why?
>>
>>p.s. Its a game with lots of system access going on.
>>
>>--
>>http://www.it-is-...
>>
>
>
> Please try to cut down your program to a minimal example, and post the minimal example here.
>
> Regards,
>
> Brian
>

Just to let you know, I cancelled this post after posting - obviously
it didn't get cancelled. That's the thing about usenet. Sorry about
that.


--
http://www.it-is-...