Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't apply non-funcallable object #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lisp-unit.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,13 @@ assertion.")
;; Report function arguments
(internal-assert
:result ',form
(lambda () (apply ,fname ,args)) ; Evaluate the form
;; fix issue #44
;; JN we can't insert ,fname because it might be a local function and that is not funcallable by quoted name.
;; so we have to use ,(car form) as that's the user given function name
;; we still can't apply that because it might be a local function
;; so we have to wrap it in (function ...) which tells the compiler to look for the function
;; by correct scoping rules.
(lambda () (apply (function ,(car form)) ,args))
(lambda () ,t-or-f)
;; Concatenate the args with the extras
(lambda ()
Expand Down