AccelerationNet / access

A common lisp library to unify access to common dictionary-like data-structures
Other
84 stars 12 forks source link

Passing non-types to subtypep in %initialize-null-container #9

Closed Yehouda closed 2 years ago

Yehouda commented 4 years ago

In access.lisp, %initialize-null-container calls suptypep with its type argument, which apparently can also be a keyword. %initialize-null-container itself checks for :hash-table and :array, and running the tests for package "CLSQL-HELPER-TEST" it is also called with :alist.

These keywords are not valid type specifiers, so subtypep needs to invoke error in this case (and does it on LispWorks). Presumably some other Lisp implementation retuns NIL in this case, but that is non-standard, because the standarad allows subtypep to return nil only in a specific set of situations: either it knows that the first type is not a subtype of the second, or either of them involves and, eql, or the list form of function, member, not, or, satisfies, or values. http://www.lispworks.com/documentation/lw71/CLHS/Body/f_subtpp.htm

Assuming there is a fixed set of keywords that %initialize-null-container can be called with, it can first check for these before starting to use subtypep. Alternatively, if it always keywords it can us keywordp to check befoe calling subtypep.

bobbysmith007 commented 4 years ago

Thanks again for your bug report. I hope to address this at some point, but there is a lot on my plate and none of it is currently lisp.

bobbysmith007 commented 2 years ago

This issue was solved by fjl and merged just now