Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1622 views
"without inline" shot cpu use to 100%. Way unacceptable. In fact, i could no longer run tests on it.
Ouch...that's...surprising...
But i believe i fixed the problem of redeclaring the variables inside a loop, now may i suggest the interpreter catch that sorta occurance and forbid it in the future?
You may suggest it, but I'm pretty sure it won't be done. This was a very purposeful and useful feature addition. Were variables actually redeclared in the same scope (or in a scope contained in the original scope)? That would be a bug. Declaring variables inside a loop is not redeclaring, and isn't a bug.
Matt
Ok, in chat_server, there is this nest (listing only the relavant stuff):
procedure main(sequence args) while sock:listen(server, 0) label "MAIN" do object sock_data = sock:select({ server } & clients, 0) if sock_data[1][SELECT_IS_READABLE] = 1 then object client = sock:accept(server) object got_data = sock:receive(client[1], 0) end if for i = 2 to length(sock_data) do if sock_data[i][SELECT_IS_READABLE] then object got_data = sock:receive(sock_data[i][SELECT_SOCKET], 0) end if end for end while end procedure
Are you saying each instance of "object whatever" isn't a problem in that code? Especially the two "object got_data", which is the variable i was having trouble with?
useless