<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>use Machine.add.  The docs aren't descriptive, but when you Machine.add a ChucK program, any classes it defines will be available in the runtime for any future chuck programs you add to the VM.  The ChucK compiler is single-pass and has no concept of make files or a build system, though, so if you want one file to include another file, you have to have a third file that defines the order to add the files to the VM.  </div><div><br></div><a href="http://chuck.cs.princeton.edu/doc/language/spork.html">http://chuck.cs.princeton.edu/doc/language/spork.html</a><div><br></div><div>e.g., here's an example of a ChucK program that I invoke that imports a bunch of other utility files: <a href="https://github.com/jordanorelli/wii-chuck-synth/blob/master/resin.ck">https://github.com/jordanorelli/wii-chuck-synth/blob/master/resin.ck</a></div><div><br></div><div>if you look in resin_run.ck, I utilize some of the stuff that is imported in resin.ck.  resin_run.ck will fail to compile if those other files aren't already loaded into the VM, so it's resin that I run from the command line.</div><div><br></div><div><br></div><div><br></div><div><a href="http://chuck.cs.princeton.edu/doc/language/spork.html"></a><br><div><div>On Mar 5, 2012, at 5:41 PM, George Locke wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">Hi,<div><br></div><div>I want to make a library of functions that I can call from any chuck script.  If I put those functions in one file, how do I access them from another?  It would be great if I could make them into a new namespace, akin to Std.X or Math.X (I am using miniAudicle 0.2.0, not command line.)  </div>

<div><br></div><div>(I checked the language specification for the words "include" and "import" and found nothing relevant.)</div><div><br></div><div>Thanks,</div><div>George</div><div><br></div><div>(I am new to chuck, but not to computer programming, nor computer audio.)</div>

<div><br></div><div>PS is there a popular/built-in solution for making exponentially distributed, normally distributed, etc random variables?
</div><div><br></div><div>PPS If not, I'd be happy to share my work - is there a common way for people to share code like this?</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>https://lists.cs.princeton.edu/mailman/listinfo/chuck-users<br></blockquote></div><br></div></body></html>