Re: apply bug?

From: David Fox <fox_at_first.cs.nyu.edu>
Date: Thu, 10 Nov 94 23:10:30 -0500

soma_at_cs.unm.edu writes:

> *** Error:
> apply: bad procedure: #[subr and]
> STk> (and #t #f)
> #f
> STk> (apply list '(#t #f))
> (#t #f)

As I understand it, this is fairly normal behavior for lisp and
scheme interpreters. "And" and "or" are special forms, since
they don't always evaluate all their arguments, so they can not
be passed to apply the way regular functions can. You could
always do something like

 (define my-and
   (lambda args
     (if (null? args) #t (and (car args) (apply my-and (cdr args))))))
Received on Fri Nov 11 1994 - 05:14:24 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST