The function foreign-type-equal-p
returns true if type1 and type2 are the same underlying foreign type, and false otherwise.
(fli:define-foreign-type aa () '(:signed :byte))
=>
aa
(fli:define-foreign-type bb () '(:signed :char))
=>
bb
(fli:foreign-type-equal-p 'aa 'bb)
=>
t
(fli:foreign-type-equal-p 'bb :char)
=>
nil
LispWorks Foreign Language Interface User Guide and Reference Manual - 16 Feb 2015