>From 2fdeaab6f1f3f240a6e45427d8ccd590d9e7e612 Mon Sep 17 00:00:00 2001 From: Christian Kellermann
Date: Sun, 25 Mar 2012 13:58:25 +0200 Subject: [PATCH] Capture length in case-lambda to make it hygienic This fixes bug #805 as reported by Moritz. --- chicken-syntax.scm | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/chicken-syntax.scm b/chicken-syntax.scm index 08bede2..a47763f 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 -- 1.7.6