[chuck-users] imports/includes
Michael Heuer
heuermh at gmail.com
Sat Aug 8 14:34:53 EDT 2020
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 <curtullerich at 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 at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200808/10912084/attachment.html>
More information about the chuck-users
mailing list