Re: out of memory, even tho remembered nothing!
- Posted by useless_ Oct 18, 2012
- 1663 views
jimcbrown said...
CoJaBo2 said...
One thing strikes me as odd here- It keeps running because... length(-1) == 1; is this intentional? I thought it used to print something to the effect of "length of an atom is undefined"
This was an enhancement to 4.0, to remove countless "if sequence() then ... length()" checks.
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.
useless