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

mike clemow michaelclemow at gmail.com
Sat Feb 6 16:37:12 EST 2010


Andrew,

Not that this helps you out or even lends to your argument, but I've been
pre-processing my input files so that ChucK can read them easier.  I have a
feeling that the file IO for ChucK owes part of its heritage to the
processing of SKINI files, which is a Perry Cook thing.  The current IO
methods seem to be ideally suited for this purpose.

https://ccrma.stanford.edu/software/stk/skini.html

But I'm with you, man: string parsing / regex stuff is absolutely necessary
to make any sort of FileIO worth our while.

Should also be fairly easy to wrap up some basic C++ stuff into Chuck.

Unhelpfully,
Mike

2010/2/6 Andrew C. Smith <andrewchristophersmith at gmail.com>

> 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
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>


-- 
http://michaelclemow.com
http://semiotech.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20100206/25089d4c/attachment.html>


More information about the chuck-users mailing list