AccelerationNet / access

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

APPLY called with literal list argument #10

Closed phoe closed 3 years ago

phoe commented 3 years ago

https://github.com/AccelerationNet/access/blob/8a8259e5c93605e9c68cc697efee71d09d6fc873/access.lisp#L492-L498

(apply '(setf aref) ...) is likely non-conforming CL because lists are not funcallable. In other words, a list is not a function designator, and apply accepts only function designators (as opposed to extended function designators, which are allowed to be lists).

We probably want (apply #'(setf aref) ...) instead.

phoe commented 3 years ago

More: #'(setf aref) needs not even exist, and is therefore also non-portable.

CLHS 5.1.1.2 states:

For each standardized accessor function F, unless it is explicitly documented otherwise, it is implementation-dependent whether the ability to use an F form as a setf place is implemented by a setf expander or a setf function. Also, it follows from this that it is implementation-dependent whether the name (setf F) is fbound.

Using (setf (apply ...) ...) should be considered instead, as per CLHS 5.1.2.5.

bobbysmith007 commented 3 years ago

Thank you, I dont do very much lisp at all for the past couple years. I appreciate you assistance

phoe commented 3 years ago

No problem - thank you for the merge.

On 03.09.2021 19:29, Russ Tyndall wrote:

Thank you, I dont do very much lisp at all for the past couple years. I appreciate you assistance

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AccelerationNet/access/issues/10#issuecomment-912696242, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSZHKTZ6VQTZUHDSILKTWLUAEAXNANCNFSM4VLX2WZA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.