[chuck-users] imports/includes

Curtis Ullerich curtullerich at gmail.com
Sat Aug 8 14:46:11 EDT 2020


Thanks for confirming. I subscribed to the issue in case it gains traction.

I found it curious that Machine.add used in the header of control.ck
doesn't work, but it works if the libs and control.ck are Machine.added in
the same file. Why is that?


On Sat, Aug 8, 2020, 11:35 Michael Heuer <heuermh at gmail.com> wrote:

> 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 at 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:
>
> chuck lib0.ck lib1.ck control.ck
>
> or, make another file control-main.ck:
> Machine.add("lib0.ck");
> Machine.add("lib1.ck");
> Machine.add("control.ck");
>
> and run it as:
> chuck control-main.ck
>
> 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 at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>
> _______________________________________________
> 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/1d401ae0/attachment-0001.html>


More information about the chuck-users mailing list