~ chicken-core (chicken-5) e7fe2fb5725be459a20fe4d703a8e3367d885e6a
commit e7fe2fb5725be459a20fe4d703a8e3367d885e6a
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Oct 31 09:03:22 2011 +0100
Commit: Christian Kellermann <ckeen@pestilenz.org>
CommitDate: Sun Nov 6 11:37:30 2011 +0100
allow procedure in operator-position of evaluated list (#705, suggested by John Cowan)
Signed-off-by: Christian Kellermann <ckeen@pestilenz.org>
diff --git a/eval.scm b/eval.scm
index bc1f303e..4f65c8d0 100644
--- a/eval.scm
+++ b/eval.scm
@@ -752,10 +752,13 @@
[else #f] ) ) )
(define (compile-call x e tf cntr se)
- (let* ([fn (compile (##sys#slot x 0) e #f tf cntr se)]
- [args (##sys#slot x 1)]
- [argc (checked-length args)]
- [info x] )
+ (let* ((head (##sys#slot x 0))
+ (fn (if (procedure? head)
+ (lambda _ head)
+ (compile (##sys#slot x 0) e #f tf cntr se)))
+ (args (##sys#slot x 1))
+ (argc (checked-length args))
+ (info x) )
(case argc
[(#f) (##sys#syntax-error/context "malformed expression" x)]
[(0) (lambda (v)
Trap