Is there a more efficient (and concise) way to convert a canister’s principal to actor than actor(Principal.toText(canisterId))
?
Unless you can import it or receive it as an argument of the appropriate actor type, no, not that I can think of.
actor(canisterId)
should work for canisterId: Principal
.
Conceptually, there is no reason to first convert it to text.
Consider the above as a feature request.
True, but the historical reason for this is that this construct was, I believe, used internally to bind a canister imported by textual id to its translated Motoko type, IIRC, and then exposed as a documented language feature.