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: Thu, 22 Aug 2013 12:24:45 +0200

Forget the previous macro. Hopefully this one will do the intended job.

(define-syntax eping
  (syntax-rules ()
    ((_ h)
     (_eping (symbol->string '|h|)))
    ((_ h p1 p2 ...) (_eping (symbol->string '|h|) 'p1 p2 ...))))


On Thu, Aug 22, 2013 at 11:29 AM, Michele La Monaca
<address@hidden> wrote:
> On Wed, Jun 26, 2013 at 2:22 PM, John Cowan <address@hidden> wrote:
>> Michele La Monaca scripsit:
>>
>>> Happy pinging.
>>
>> Cool!
>>
>> I made a minor documentation change on the wiki to encourage strings over
>> symbols as hostnames, and to remove the suggestion to use dotted-decimal
>> symbols like '192.168.1.1.  Such a symbol violates both R5RS and R7RS,
>> is not portable, and might stop working some day.  (You could write it as
>> '|192.168.1.1|, but that is more verbose than the string form.)
>
> What about redefining eping as a macro to call the real eping function 
> (_eping)?
>
> (define-syntax eping
>   (syntax-rules ()
>     ((_ h p ...) (_eping (symbol->string '|h|) 'p ...))))
>
> This way you can simply:
>
> (eping 192.168.1.1)
>
> or
>
> (eping example.com)
>
> Thoughts?
>
> Ciao,
> Michele



reply via email to

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