Hello Curtis,

In LiCK there is one big import.ck file (your second method)

https://github.com/heuermh/lick/blob/master/import.ck

I typically use it with two terminal windows, in one

$ chuck --loop

and in the other

$ chuck + import.ck
$ chuck + other-stuff.ck

See also

Add namespaces and import statements
https://github.com/ccrma/chuck/issues/109

Cheers,

   michael


On Aug 8, 2020, at 12:56 PM, Curtis Ullerich <curtullerich@gmail.com> wrote:

What's the state of the art for imports/includes?

If I have files lib0.ck and lib1.ck that declare public classes both used in control.ck, I understand these to be the two options for running them:


or, make another file control-main.ck:
Machine.add("lib0.ck");
Machine.add("lib1.ck");
Machine.add("control.ck");

and run it as:

I thought it would work to use Machine.add("lib0.ck"); Machine.add("lib1.ck"); as the first line of control.ck and then just run chuck control.ck, but the included classes are not found. 

Are these the two options, or is there another way that can support transitive inclusion (not having to list each util file for every program that uses them)?

Thanks,
Curtis
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users