If importing is not possible, another good alternative would be to have multiple services, like:
# file: my_services.did
service counter: {
get : () -> (int) query;
set : (int) -> ();
inc : () -> ();
dec : () -> ();
}
service reverse: {
"go": (text) -> (text) query;
}
I could not figure out either of those approaches.
It works to just create a single service, but I would have to update the C code & rename the functions to distinguish between the counter & reverse service:
# file: my_services.did
service : {
"go": (text) -> (text) query;
get : () -> (int) query;
set : (int) -> ();
inc : () -> ();
dec : () -> ();
}
You can use import "a.did"; to import the type declaration of did file, but the main service will not be imported. Each did file can only contain a single main service. So you can import all your did files, and manually write the combined main service interface. The method name can be unicode as well, but some host language doesn’t support unicode function names.