>From a441b07473a93f5216c31ae23dd993ff61958f15 Mon Sep 17 00:00:00 2001 From: Moritz Heidkamp Date: Sun, 25 Mar 2012 14:24:07 +0200 Subject: [PATCH 1/3] Fix hygiene issues in `case-lambda' This adresses bug #805 --- chicken-syntax.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chicken-syntax.scm b/chicken-syntax.scm index 08bede2..b634d1f 100644 --- a/chicken-syntax.scm +++ b/chicken-syntax.scm @@ -764,7 +764,8 @@ `((>= . ,(##sys#primitive-alias '>=)) (car . ,(##sys#primitive-alias 'car)) (cdr . ,(##sys#primitive-alias 'cdr)) - (eq? . ,(##sys#primitive-alias 'eq?))) + (eq? . ,(##sys#primitive-alias 'eq?)) + (length . ,(##sys#primitive-alias 'length))) (##sys#er-transformer (lambda (form r c) (##sys#check-syntax 'case-lambda form '(_ . _)) @@ -785,11 +786,12 @@ (%>= (r '>=)) (%eq? (r 'eq?)) (%car (r 'car)) - (%cdr (r 'cdr))) + (%cdr (r 'cdr)) + (%length (r 'length))) `(##core#lambda ,(append minvars rvar) (##core#let - ((,lvar (length ,rvar))) + ((,lvar (,%length ,rvar))) ,(fold-right (lambda (c body) (##sys#decompose-lambda-list @@ -820,7 +822,7 @@ bindings `(##core#let ,(map list vars1 minvars) ,bindings) ) ) ) ,body) ) ) ) - '(##core#check (##sys#error (##core#immutable '"no matching clause in call to 'case-lambda' form"))) + '(##core#check (##sys#error (##core#immutable (##core#quote "no matching clause in call to 'case-lambda' form")))) (cdr form)))))))) -- 1.7.9.4