chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] ANN: eping


From: John Cowan
Subject: Re: [Chicken-users] ANN: eping
Date: Thu, 22 Aug 2013 12:39:09 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

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 just undefined-variable ones.  In
addition, you need to quote the use of h in the last line, as
it is not a variable.  In addition, change |h| to h as noted earlier.

> as regarding (symbol->string '|h|), what you are saying is that in
> this context it is equivalent to (symbol->string 'h) and that one
> happens to work only because Chicken considers '192.168.0.1 a valid
> symbol while in standard Scheme is not. Right?

Right.

> Anyway, it seems to me
> quite a limitation that IP addresses are not valid Scheme symbols and
> something that should be fixed if it is an artificially imposed
> limitation.

The idea is that the lexical scanner should be able to recognize quickly
if something is a number or a symbol, so no symbol is allowed to have a
prefix that is a valid number, with a few historical exceptions.
Chicken takes the approach of scanning a whole symbol, attempting to
convert it to a number, and if that fails assuming it's a symbol.

-- 
LEAR: Dost thou call me fool, boy?      John Cowan
FOOL: All thy other titles              http://www.ccil.org/~cowan
             thou hast given away:      address@hidden
      That thou wast born with.



reply via email to

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