<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hm, yeah, I remember you mentioned preprocessing with Python or something. This is great for what it works for (esp. since you can just write and chuck files straight from Python's shell capabilities) but even just reading a particular character in a string--reading a string as an array of 8-bit chars, for instance--would be great.</div><div><br></div><div>If I continue hacking through the string class, what are some useful methods? I saw some of the undocumented string methods like .trim() and a few others (documented in examples/strings/) but those seem like the beginnings of something taken out of the oven a little too early. What would be helpful to have, and how can I make sure that additions are transportable to other builds? Anyone want to test some new methods? With a few very, very simple string methods we could build the rest into the LiCK library.</div><div><br></div><div>Andrew</div><br><div><div>On Feb 6, 2010, at 4:37 PM, mike clemow wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Andrew,<br><br>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. <br>
<br><a href="https://ccrma.stanford.edu/software/stk/skini.html">https://ccrma.stanford.edu/software/stk/skini.html</a><br><br>But I'm with you, man: string parsing / regex stuff is absolutely necessary to make any sort of FileIO worth our while.<br>
<br>Should also be fairly easy to wrap up some basic C++ stuff into Chuck.<br><br>Unhelpfully,<br>Mike<br><br><div class="gmail_quote">2010/2/6 Andrew C. Smith <span dir="ltr"><<a href="mailto:andrewchristophersmith@gmail.com">andrewchristophersmith@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="word-wrap: break-word;">Hey list, it's been a while.<div><br></div><div>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:</div>
<div><br></div><div><div style="margin: 0px;"><span style="color: rgb(51, 0, 255);">if</span> (scale.more() && scale.read(<span style="color: rgb(232, 146, 0);">1</span>) == <span style="color: rgb(81, 81, 81);">"/"</span>) {</div>
<div style="margin: 0px;"><span style="color: rgb(51, 0, 255);"><span style="white-space: pre;"><font color="#000000">  </font></span>if</span> (scale.more()) {</div><div style="margin: 0px;"><span style="white-space: pre;">                </span>scale.readInt(<span style="color: rgb(232, 146, 0);">1</span>) => den;</div>
<div style="margin: 0px;"><span style="white-space: pre;">      </span>}</div><div style="margin: 0px;">}</div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;">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.</span></font></div>
<div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"><br></span></font></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;">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.</span></font></div>
<div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"><br></span></font></div><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;">What have you all come up with? Is anyone using FileIO? What about a Floss addition? Nice manual, by the way. Good work list.</span></font></div>
<div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;"><br></span></font></div><font color="#888888"><div style="margin: 0px;"><font face="Helvetica" size="3"><span style="font-size: 12px;">Andrew</span></font></div>
</font></div></div><br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://michaelclemow.com/">http://michaelclemow.com</a><br><a href="http://semiotech.org/">http://semiotech.org</a><br><br>
_______________________________________________<br>chuck-users mailing list<br><a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>https://lists.cs.princeton.edu/mailman/listinfo/chuck-users<br></blockquote></div><br></body></html>