Re: [Chicken-users] ANN: eping

2013-08-26 Thread Michele La Monaca
On Sat, Aug 24, 2013 at 11:28 AM, Jörg F. Wittenberger wrote: > On Aug 22 2013, Michele La Monaca wrote: > >> How can I check if a symbol is bound to a value? > > > Oleg Kiselyov's receipe might be helpful here: > http://okmij.org/ftp/Scheme/macro-symbol-p.txt Intriguing reading material, thanks.

Re: [Chicken-users] ANN: eping

2013-08-24 Thread John Cowan
Jörg F. Wittenberger scripsit: > Oleg Kiselyov's receipe might be helpful here: > http://okmij.org/ftp/Scheme/macro-symbol-p.txt Okmij is down, but the page is in the Google cache at . -- If y

Re: [Chicken-users] ANN: eping

2013-08-24 Thread Jörg F . Wittenberger
On Aug 22 2013, Michele La Monaca wrote: How can I check if a symbol is bound to a value? Oleg Kiselyov's receipe might be helpful here: http://okmij.org/ftp/Scheme/macro-symbol-p.txt I would like to do this: (define host "example.com") (eping host) ; host is evaluated (eping localhos

Re: [Chicken-users] ANN: eping

2013-08-23 Thread Michele La Monaca
On Thu, Aug 22, 2013 at 10:15 PM, Michele La Monaca wrote: > On Thu, Aug 22, 2013 at 6:39 PM, John Cowan 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

Re: [Chicken-users] ANN: eping

2013-08-22 Thread Michele La Monaca
On Thu, Aug 22, 2013 at 6:39 PM, John Cowan wrote: > Michele La Monaca scripsit: > >> I think eval usage (and limitations) can be avoided: For example: >> >> (define-syntax eping >> (syntax-rules () >> ((_ h) >> (handle-exceptions exn >>(_eping (symbol->string '|h|)) >>(

Re: [Chicken-users] ANN: eping

2013-08-22 Thread John Cowan
Michele La Monaca scripsit: > I think eval usage (and limitations) can be avoided: For example: > > (define-syntax eping > (syntax-rules () > ((_ h) > (handle-exceptions exn >(_eping (symbol->string '|h|)) >(let ((t h)) (_eping t)) That traps all exceptions, not ju

Re: [Chicken-users] ANN: eping

2013-08-22 Thread Michele La Monaca
On Thu, Aug 22, 2013 at 4:54 PM, John Cowan wrote: > Your macro will work as far as handling bound and unbound symbols; of > course, symbols *lexically* bound will not be seen, only global symbols. > That's the nature of Scheme's eval. I think eval usage (and limitations) can be avoided: For exa

Re: [Chicken-users] ANN: eping

2013-08-22 Thread John Maxwell
On 08/22/13 10:54:44, John Cowan wrote: > Like your earlier macro that attempts to remap h to |h|, this one > won't > quite work, because the difference between h and |h| disappears in > the > reader, and the macro engine never sees it. 192.168.0.1 is simply > not > valid Scheme lexical syntax,

Re: [Chicken-users] ANN: eping

2013-08-22 Thread John Cowan
Michele La Monaca scripsit: > How can I check if a symbol is bound to a value? By using eval and trapping any error, as you mention below, but that's not to the purpose here. You are trying to do with macros what macros cannot do. > (define-syntax eping > (syntax-rules () > ((_ h) >

Re: [Chicken-users] ANN: eping

2013-08-22 Thread Michele La Monaca
How can I check if a symbol is bound to a value? I would like to do this: (define host "example.com") (eping host) ; host is evaluated (eping localhost) ; localhost is treated as a symbol with a macro like that: (define-syntax eping (syntax-rules () ((_ h) (if (and (symbol? 'h)

Re: [Chicken-users] ANN: eping

2013-08-22 Thread Michele La Monaca
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 wrote: > On Wed,

Re: [Chicken-users] ANN: eping

2013-08-22 Thread Michele La Monaca
On Wed, Jun 26, 2013 at 2:22 PM, John Cowan 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

Re: [Chicken-users] ANN: eping

2013-06-26 Thread John Cowan
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

[Chicken-users] ANN: eping

2013-06-26 Thread Michele La Monaca
Hi all! those interested in network management/monitoring might find this egg useful: https://wiki.call-cc.org/eggref/4/eping Happy pinging. Ciao, Michele ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listin