[chuck-users] adding a chuck class from an external file

Juan-Pablo Caceres jcaceres at ccrma.stanford.edu
Tue Nov 6 21:56:22 EST 2007


Hello,

Doing some research on how to add a class that is defined in an external 
file I came across an email Ge sent explaining this wasn't possible yet:

https://lists.cs.princeton.edu/pipermail/chuck-users/2006-March/000440.html
=====================================================================
foo.ck
---
public class Foo
{ /* stuff */ }
---

bar.ck
---
machine.add( "foo.ck" );
Foo foo;  // this won't pass the type checker
---

running bar.ck first (the intended usage) would result in a type
checker error 'unknown class Foo', since foo.ck won't be added until
runtime and so 'Foo' is unknown when bar.ck is compiled.
=====================================================================

I remember though him also saying that the way to add external functions 
(functions defined in an external file) was to create a classes that 
contains them.

So is there any new way to add a class defined in an external class? 
Your help is greatly appreciated.

JPa.


More information about the chuck-users mailing list