chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] ANN: eping


From: Michele La Monaca
Subject: Re: [Chicken-users] ANN: eping
Date: Fri, 23 Aug 2013 15:17:48 +0200

On Thu, Aug 22, 2013 at 10:15 PM, Michele La Monaca
<address@hidden> wrote:
> On Thu, Aug 22, 2013 at 6:39 PM, John Cowan <address@hidden> wrote:
>> Michele La Monaca scripsit:
>
> (define-syntax bound?
>   (syntax-rules ()
>     ((_ exp) (handle-exceptions exn #f (atom? exp) #t))))

The macro above has an useless atom? call and side-effects (exp is
evaluated no matter what).

Hopefully my next attempt is the last one:

(define-syntax bound?
  (syntax-rules ()
  ((_ exp)
   (handle-exceptions exn #f (if (symbol? 'exp) exp #t) #t))))

This macro try to evaluate exp only if it is a symbol and that kind of
"evaluation" has no side effects. Right?



reply via email to

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