[chuck-users] Some recent thoughts
signal.automatique at gmail.com
Thu Sep 20 06:36:48 EDT 2007
I was thinking while lying awake last night.... One of the big questions at
the moment is writing non-wave data to disc and recalling it. This would be
useful for storing the outcome of (random) algorithms, settings tuned by the
use of interfaces and any number of other useful and appealing things. I'm
certain we'll have this in the future, but what about right now?
One idea I had that I have yet to try in practice is that we could try
abusing the call for the OS to execute a terminal command. One of the very
old-fashioned commands all three OS's that ChucK runs on is writing a line
to a new file or appending a line to a existing file so with some abuse of
the new function to form strings we could writem then save a file. If that
file would contain a array and a simple command to assign that to a static
array in a public class simply executing the file we wrote would give us
back the data, asuming we defined some format for this.
This is roundabout and not that beautiful but it could help someone out so I
thought I'd share.
One thing this would lead to is a .ck file that would work on either Windows
or OSX&Linux and that would decrease the communicative value of that code,
I'm less then happy about that. We could work with a condition and execute
either of two versions of this call if only we could detect what the host OS
is but I don't believe we can. Would it be a idea to have a standard library
function to simply ask the OS what it is or use the fact that upon compiling
ChucK we already know what it will run on since we need to set a flag for
what version we are building?
That's how far I got before dozing off... Perhaps helpful or interesting to
PS; the same technique might conceivably be used to append lines to the
program itself. This sounds like a exciting, daring and dangerous plan that
I haven't yet found a use for. Abuse with care.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the chuck-users