From: Guillermo J. Rozas Date: Fri, 18 Feb 1994 22:33:05 +0000 (+0000) Subject: Improve duplicate parameter test in lambda.scm X-Git-Tag: 20090517-FFI~7280 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e1bda26a11a58b65618332c70cfeedd2020e8add;p=mit-scheme.git Improve duplicate parameter test in lambda.scm --- diff --git a/v7/src/runtime/lambda.scm b/v7/src/runtime/lambda.scm index 9dcd2c1a0..0ef599699 100644 --- a/v7/src/runtime/lambda.scm +++ b/v7/src/runtime/lambda.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: lambda.scm,v 14.11 1994/01/29 21:34:20 adams Exp $ +$Id: lambda.scm,v 14.12 1994/02/18 22:33:05 gjr Exp $ -Copyright (c) 1988-1992 Massachusetts Institute of Technology +Copyright (c) 1988-1994 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -375,11 +375,10 @@ MIT in each case. |# (xlambda? object))) (define (make-lambda name required optional rest auxiliary declarations body) - (if (or (list-has-duplicates? required) - (list-has-duplicates? optional) - (list-has-duplicates? auxiliary) - (there-exists? required (lambda (name) (memq name optional))) - (and rest (or (memq rest required) (memq rest optional)))) + (if (list-has-duplicates? (append required + optional + (if rest (list rest) '()) + auxiliary)) (error "one or more duplicate parameters" required optional rest auxiliary)) (let ((body* (if (null? declarations)