[chuck-users] New FileIO options, broken stuff from CVS: FileIO.read(int)

Andrew C. Smith acsmith at willamette.edu
Mon Oct 5 08:51:07 EDT 2009


Dear List (mostly Ge & other people who know about the brand-new dracula)

First of all, great new ChucK. The FileIO is great to have, and it's
good to see it implemented fairly comprehensively. I like how
FileIO.readInt() or readFloat() just becomes FileIO => (int), too.

Anyway, I was previously using FileIO.read(int) in my Scala file
importer to parse a line and look for a "/" after the first integer
(making it a ratio, rather than cents). There doesn't seem to be a
FileIO.read method around anymore, though, which makes some sense
since readInt and readFloat aren't used now. I was going to wade back
through the source, which is where I found read(int) in the first
place, but thought I should at least let you all know that the method
was being used. Are there any good alternatives to .read()?

My issue with reading in a string was that there's no space between
the number and the "/" in Scala files, so it would read as one long
string. Then, parsing the string into multiple bits, all that sort of
thing...really difficult. My method was to read in a float, look for a
"/" (with .read(1) == "/" ), and if it found one read in another float
and calculate the ratio; if it didn't find one, calculate it as
musical cents. Thanks for the help.

Best,
Andrew


More information about the chuck-users mailing list