Hello Curtis,

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

https://github.com/heuermh/lick/blob/master/import.ck 
<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 
<https://github.com/ccrma/chuck/issues/109>

Cheers,

   michael


> On Aug 8, 2020, at 12:56 PM, Curtis Ullerich <curtuller...@gmail.com> wrote:
> 
> What's the state of the art for imports/includes?
> 
> If I have files lib0.ck <http://lib0.ck/> and lib1.ck <http://lib1.ck/> that 
> declare public classes both used in control.ck <http://control.ck/>, I 
> understand these to be the two options for running them:
> 
> chuck lib0.ck <http://lib0.ck/> lib1.ck <http://lib1.ck/> control.ck 
> <http://control.ck/>
> 
> or, make another file control-main.ck <http://control-main.ck/>:
> Machine.add("lib0.ck <http://lib0.ck/>");
> Machine.add("lib1.ck <http://lib1.ck/>");
> Machine.add("control.ck <http://control.ck/>");
> 
> and run it as:
> chuck control-main.ck <http://control-main.ck/>
> 
> I thought it would work to use Machine.add("lib0.ck <http://lib0.ck/>"); 
> Machine.add("lib1.ck <http://lib1.ck/>"); as the first line of control.ck 
> <http://control.ck/> and then just run chuck control.ck <http://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

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

Reply via email to