bkovitz
2018-10-29 22:14:32

How can you import a struct into a unit? I’m getting this error message when I try to call struct-copy on a struct imported via a signature: struct-copy: not all accessors are statically known for structure type in: graph.


samth
2018-10-29 22:35:50

@bkovitz is there a reason you’re using units? I wouldn’t recommend them


bkovitz
2018-10-29 22:36:48

I’m trying to make it easy to swap different parts of this thing in and out—and to make the source code overall more manageable by breaking it up.


bkovitz
2018-10-29 22:38:46

Is there something better that I should be using? Or do units have problems that might mean I’ll be better off living with the sprawl that I have now?


samth
2018-10-29 23:31:31

I think multiple modules, and parametrizing things with functions, are what I’d recommend


bkovitz
2018-10-30 00:49:30

Thanks. I’ll give up on the units and try splitting up the code into more modules, and maybe a macro or something to “link” functions together.


bkovitz
2018-10-30 00:51:49

Units seem like a great idea. I tried to implement something like them in both Scala and Clojure, so I could toss modules together easily and run experiments that compare different alternative modules. I never got it to work satisfactorily, though.