Re: out of memory, even tho remembered nothing!

new topic     » goto parent     » topic index » view thread      » older message » newer message
jaygade said...
eukat said...

So why can't i do this any more?

readfile = open(readfilename,"rb") 
junk = gets(readfile) 
while junk do 
  size += length(junk) 
  puts(1,sprintf("%d",size)&"\r") 
  junk = gets(readfile) 
end while 


It fails to run because junk isn't an atom. But then, if it was an atom, it would be -1, and not execute the while loop. So i still must do the type checks on it.

Wouldn't this hang as an infinite loop if junk is -1 (a true value) anyway?

http://openeuphoria.org/docs/lang_loop.html#_156_whilestatement

Yes. I tested this with Euphoria 2.3, and a "while -1 do" loop will loop forever even with that old interpreter.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu