chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] unbound variable: or


From: Michele La Monaca
Subject: Re: [Chicken-users] unbound variable: or
Date: Fri, 29 May 2015 02:17:00 +0200

On Thu, May 28, 2015 at 1:53 AM, John Cowan <address@hidden> wrote:
> Jinsong Liang scripsit:
>
>> Then is there a straightforward way to get a list of booleans "or"ed? I
>> tried "fold" with "or" but it does not work either. It seems writing a loop
>> or a recursion for this is a little overkill.
>
> You want "any".

Or you can write down your own apply which applies to macros:

(define-macro apply-syntax
  (lambda (macro args)
    `(,macro ,@args)))

(define-syntax apply-syntax
  (syntax-rules ()
    ((_ macro (args ...)) (macro args ...))))


(apply-syntax or (#f (+ 1 2) (print "hello")))

=> 3

Regards,
Michele



reply via email to

[Prev in Thread] Current Thread [Next in Thread]