home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.scheme
- Path: sparky!uunet!think.com!ames!pasteur!volga.Berkeley.EDU!matt
- From: matt@volga.Berkeley.EDU (Matt Wright)
- Subject: Re: arity problem
- Message-ID: <1992Nov13.180132.5267@pasteur.Berkeley.EDU>
- Sender: nntp@pasteur.Berkeley.EDU (NNTP Poster)
- Nntp-Posting-Host: volga.berkeley.edu
- Organization: University of California, at Berkeley
- References: <1992Nov12.234655.12264@newssrv.edvz.univie.ac.at>
- Date: Fri, 13 Nov 1992 18:01:32 GMT
- Lines: 22
-
- Erich Neuwirth writes:
- >i want to do the following:
- >i need a function which takes a logical function as input and
- >returns the function which is just the negation.
-
- (define (negate f)
- (lambda args
- (not (apply f args)) ))
-
-
- If the first "argument" to lambda isn't a list, then the function that's
- returned takes any number of arguments.
-
- You can also say
-
- (lambda (foo bar . baz)
- ...)
-
- Meaning two or more arguments. The first is foo, the second is bar, and the
- rest (if any) are put in a list that baz is bound to.
-
- -Matt
-