Through things like this library, which, combined with a Sufficiently Smart Compiler (SBCL qualifies as one for this purpose), produces C++-like static dispatch for cases such as the one you&#x27;re proposing. <a href="https:&#x2F;&#x2F;github.com&#x2F;guicho271828&#x2F;inlined-generic-function" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;guicho271828&#x2F;inlined-generic-function</a>