DigiNews

Tech Watch by Johan Denoyer

← Back to articles

Unexpected (to me) behaviour in Lisp sub-typing

Quality: 8/10 Relevance: 8/10

Summary

Simon Dobson analyzes unexpected behaviour in Common Lisp array sub-typing (SBCL). The post shows that specialised and default simple-array values may fail type checks when constraining element types (for example unsigned-byte 16) due to upgrades to upgraded-array-element-type. A practical workaround is to explicitly specify the element-type or to use an explicit value to create arrays. The post also discusses why this happens and its relation to array representation optimisations.

🚀 Service construit par Johan Denoyer