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
<mikele.chic...@lamonaca.net> wrote:
> On Wed, Jun 26, 2013 at 2:22 PM, John Cowan <co...@mercury.ccil.org> 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

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

Reply via email to