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

iron out inconsistency between eval and compile expansion

* libguile/expand.c (expand_lambda_star_case): Harmonize with tree-il,
  expanding keywords to (aok? (kw name gensym) ...), not
  (aok? (kw . index) ...).

* libguile/memoize.c (memoize): Process the (kw name gensym) format into
  (kw . index).

* module/ice-9/psyntax.scm (build-lambda-case): Remove a
  compile-versus-eval special case.

* module/ice-9/psyntax-pp.scm: Regenerate.
This commit is contained in:
Andy Wingo 2010-05-20 12:53:21 +02:00
parent a310a1d12e
commit 632ddbf02b
4 changed files with 8277 additions and 8462 deletions

File diff suppressed because it is too large Load diff

View file

@ -460,31 +460,7 @@
;; the body of a lambda: anything, already expanded
;; else: lambda-case | #f
(lambda (src req opt rest kw inits vars body else-case)
;; FIXME!!!
(case (fluid-ref *mode*)
((c)
((@ (language tree-il) make-lambda-case)
src req opt rest kw inits vars body else-case))
(else
;; Very much like the logic of (language tree-il compile-glil).
(let* ((nreq (length req))
(nopt (if opt (length opt) 0))
(rest-idx (and rest (+ nreq nopt)))
(allow-other-keys? (if kw (car kw) #f))
(kw-indices (map (lambda (x)
;; (,key ,name ,var)
(cons (car x) (list-index vars (caddr x))))
(if kw (cdr kw) '())))
(nargs (apply max (+ nreq nopt (if rest 1 0))
(map 1+ (map cdr kw-indices)))))
(or (= nargs
(length vars)
(+ nreq (length inits) (if rest 1 0)))
(error "something went wrong"
req opt rest kw inits vars nreq nopt kw-indices nargs))
(make-lambda-case src req opt rest
(and kw (cons allow-other-keys? kw-indices))
inits vars body else-case))))))
(make-lambda-case src req opt rest kw inits vars body else-case)))
(define build-primref
(lambda (src name)