1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-21 03:00:19 +02:00

interpreted closures cons less.

* module/ice-9/eval.scm (primitive-eval): When making a closure with N
  formals, actuall return a closure with N formals, if N is less than
  *max-static-argument-count*, which currently is 8. If N is greater
  than 8, do the arg-parsing loop as we did before. Requires some
  macrology, but should reduce unnecessary consing for interpreted
  closures.

* test-suite/tests/goops.test:
* test-suite/tests/hooks.test: Now that checks like (thunk? foo) are
  going to work as a for interpreted code, remove some (throw
  'unresolved).
This commit is contained in:
Andy Wingo 2009-12-13 16:18:39 +01:00
parent 271a32dbc2
commit 4abb824cdb
3 changed files with 55 additions and 30 deletions

View file

@ -167,10 +167,6 @@
(expect-fail "bad init-thunk"
(begin
;; Currently UPASSing because we can't usefully get
;; any arity information out of interpreted
;; procedures. A FIXME I guess.
(throw 'unresolved)
(catch #t
(lambda ()
(eval '(define-class <foo> ()

View file

@ -52,12 +52,7 @@
(pass-if-exception "illegal proc"
exception:wrong-type-arg
(let ((x (make-hook 1)))
;; Currently fails to raise an exception
;; because we can't usefully get any arity
;; information out of interpreted procedures. A
;; FIXME I guess.
(throw 'unresolved)
(add-hook! x bad-proc)))
(add-hook! x bad-proc)))
(pass-if-exception "illegal hook"
exception:wrong-type-arg
(add-hook! '(foo) proc1)))