Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Moringen
asdf
Commits
182c5bd0
Commit
182c5bd0
authored
11 years ago
by
Francois-Rene Rideau
Browse files
Options
Downloads
Patches
Plain Diff
Fix lp#1225898: ENSURE-FUNCTION must specially treat LAMBDA.
parent
5b93d09a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/test-around-compile-lambda.script.dont-run
+0
-12
0 additions, 12 deletions
test/test-around-compile-lambda.script.dont-run
test/test-around-compile.script
+18
-9
18 additions, 9 deletions
test/test-around-compile.script
uiop/utility.lisp
+5
-2
5 additions, 2 deletions
uiop/utility.lisp
with
23 additions
and
23 deletions
test/test-around-compile-lambda.script.dont-run
deleted
100644 → 0
+
0
−
12
View file @
5b93d09a
;;; -*- Lisp -*-
(progn
(def-test-system test-around-compile-lambda
:around-compile (lambda (thunk)
(let ((*read-base* 2))
(funcall thunk)))
;; :depends-on ((:version :asdf "2.017.18")) ; no :around-compile before that.
:components ((:file "test")))
(load-system 'test-around-compile-lambda :force t)
(assert (= 3 (funcall 'add10 1)))) ;; add10 must have been compiled in base 2
This diff is collapsed.
Click to expand it.
test/test-around-compile.script
+
18
−
9
View file @
182c5bd0
;;; -*- Lisp -*-
(defun call-in-base-2 (thunk)
(let ((*read-base* 2))
(funcall thunk)))
(progn
(def-test-system test-around-compile
:around-compile call-in-base-2
;; :depends-on ((:version :asdf "2.017.18")) ; no :around-compile before that.
:components ((:file "test")))
(load-system 'test-around-compile :force t)
(assert (= 3 (funcall 'add10 1)))) ;; add10 must have been compiled in base 2
(DBG "Testing around-compile with a function name")
(def-test-system test-around-compile
:around-compile call-in-base-2
;; :depends-on ((:version :asdf "2.017.18")) ; no :around-compile before that.
:components ((:file "test")))
(load-system 'test-around-compile :force t)
(assert (= 3 (funcall 'add10 1))) ;; add10 must have been compiled in base 2
(fmakunbound 'add10)
(DBG "Testing around-compile with a lambda")
(def-test-system test-around-compile-lambda
:around-compile (lambda (thunk)
(let ((*read-base* 2))
(funcall thunk)))
:components ((:file "test")))
(load-system 'test-around-compile-lambda :force t)
(assert (= 3 (funcall 'add10 1))) ;; add10 must have been compiled in base 2
This diff is collapsed.
Click to expand it.
uiop/utility.lisp
+
5
−
2
View file @
182c5bd0
...
...
@@ -318,14 +318,17 @@ If the FUN is a non-sequence literal constant, return constantly that,
i.e. for a boolean keyword character number or pathname.
Otherwise if FUN is a non-literally constant symbol, return its FDEFINITION.
If FUN is a CONS, return the function that applies its CAR
to the appended list of the rest of its CDR and the arguments.
to the appended list of the rest of its CDR and the arguments,
unless the CAR is LAMBDA, in which case the expression is evaluated.
If FUN is a string, READ a form from it in the specified PACKAGE (default: CL)
and EVAL that in a (FUNCTION ...) context."
(
etypecase
fun
(
function
fun
)
((
or
boolean
keyword
character
number
pathname
)
(
constantly
fun
))
((
or
function
symbol
)
fun
)
(
cons
#'
(
lambda
(
&rest
args
)
(
apply
(
car
fun
)
(
append
(
cdr
fun
)
args
))))
(
cons
(
if
(
eq
'lambda
(
car
fun
))
(
eval
fun
)
#'
(
lambda
(
&rest
args
)
(
apply
(
car
fun
)
(
append
(
cdr
fun
)
args
)))))
(
string
(
eval
`
(
function
,
(
with-standard-io-syntax
(
let
((
*package*
(
find-package
package
)))
(
read-from-string
fun
))))))))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment