[plt-scheme] Scheme Idiom

From: Owen Landgren (olandgren at Macalester.edu)
Date: Thu Sep 5 10:34:59 EDT 2002

Guys,

A quick and perhaps trivial question. I have a list of booleans, and
wish to apply an logical or to the members of said list. The obvious
solution,

(apply or lst) 

doesn't work because 'or' is a keyword, not a procedure. However, both
of the two solutions I've found feel like ugly hacks:

(eval (append
	'(or)
	lst))

and 

(call-with-current-continuation
  (lambda (kont)
    (map (lambda (bool)
	   (if bool
              (kont bool)))
          lst)
   #f))

Is there a nicer idiom for this particular task? 

Thanks,
Owen Landgren





Posted on the users mailing list.