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: Jinsong Liang
Subject: Re: [Chicken-users] unbound variable: or
Date: Thu, 28 May 2015 21:10:03 -0400

Thank you Michele! This is a nice example.

Jinsong


On Thursday, May 28, 2015, Michele La Monaca <address@hidden> wrote:
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

_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users

reply via email to

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