[chuck-users] FileIO.read( int ) -- why not implement?

Andrew C. Smith andrewchristophersmith at gmail.com
Sat Feb 6 11:23:54 EST 2010


Hey list, it's been a while.

I've got this quick little script for reading in Scala files, and there's a particularly important part of it that goes like this:

if (scale.more() && scale.read(1) == "/") {
	if (scale.more()) {
		scale.readInt(1) => den;
	}
}

Basically, I'm just reading in from the file (FileIO scale) to see if the next character is a slash. If so, it's a ratio and I assume that the next number is the denominator. However, I had to go in and un-comment the whole FileIO.read(int) section in the source code. I haven't had any problems with it and can't figure out why it was commented out. It seems so useful to just read a particular number of characters, but this workaround means that I can't share my code with anyone else very easily.

Also, we had that wish list going and no one ever said (at least not that I saw) "regular expressions." But, seriously, that would be so helpful for parsing outside information. And I think you all know how much fun it is to pump random outside data through algorithms. I don't exactly see how the FileIO thing is particularly useful unless there's some way of parsing the data.

What have you all come up with? Is anyone using FileIO? What about a Floss addition? Nice manual, by the way. Good work list.

Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20100206/ede0a228/attachment.htm>


More information about the chuck-users mailing list