Re: out of memory, even tho remembered nothing!
- Posted by useless_ Oct 18, 2012
- 1559 views
jimcbrown said...
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.
I have previously considered any value (whether bit byte, char, string, etc) over 0 as TRUE and any value of zero or less to be FALSE. I refer you to:
http://i53.tinypic.com/x6c6fd.jpg
useless