That’s indeed why I asked this question. I am surprised that Julia does not provide a simple way of doing this.