[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/listinfo/chicken-users


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 stop working some day.  (You could write it as
'|192.168.1.1|, but that is more verbose than the string form.)

-- 
John Cowanhttp://ccil.org/~cowanco...@ccil.org
Mr. Henry James writes fiction as if it were a painful duty.  --Oscar Wilde

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


[Chicken-users] dynamic scoping

2013-06-26 Thread Daniel Ajoy

add binds a to 1 at the moment of definition.

#;48 (define a 1)
#;49 (define (add x) (+ x a) )
#;50 (add 10)
11
#;51 (let ((a 100) ) (add 10) )
11

Is there a way to give a different value of a to add, so that, something like 
this happens:

(let ((a 100) ) (add 10) )
110

Daniel

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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread Evan Hanson
Have a look at parameter objects.

http://api.call-cc.org/doc/chicken/parameters

Evan

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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread Dan Leslie

By using parameters; see also:

http://api.call-cc.org/doc/chicken/parameters/make-parameter
http://api.call-cc.org/doc/miscmacros/define-parameter
http://api.call-cc.org/doc/chicken/special-forms/parameterize

-Dan

On 6/26/2013 2:47 PM, Daniel Ajoy wrote:

add binds a to 1 at the moment of definition.

#;48 (define a 1)
#;49 (define (add x) (+ x a) )
#;50 (add 10)
11
#;51 (let ((a 100) ) (add 10) )
11

Is there a way to give a different value of a to add, so that, 
something like this happens:


(let ((a 100) ) (add 10) )
110

Daniel

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



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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread Patrick Useldinger

On 26/06/2013 23:47, Daniel Ajoy wrote:

add binds a to 1 at the moment of definition.

#;48 (define a 1)
#;49 (define (add x) (+ x a) )
#;50 (add 10)
11
#;51 (let ((a 100) ) (add 10) )
11

Is there a way to give a different value of a to add, so that,
something like this happens:

(let ((a 100) ) (add 10) )
110


(define a (make-parameter 1))
(define (add x) (+ x (a)))
(add 10)
(parameterize ((a 100))
  (add 10))
(add 10)

yields
11
110
11



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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread Kon Lovett
See http://api.call-cc.org/doc/chicken/special-forms#def:fluid-let

#;1 (define a 1)
#;2 (define (add x) (+ x a) )
#;3 (let ((a 100) ) (add 10) )
11
#;4 (fluid-let ((a 100) ) (add 10) )
110


On Jun 26, 2013, at 2:47 PM, Daniel Ajoy da.a...@gmail.com wrote:

 add binds a to 1 at the moment of definition.
 
 #;48 (define a 1)
 #;49 (define (add x) (+ x a) )
 #;50 (add 10)
 11
 #;51 (let ((a 100) ) (add 10) )
 11
 
 Is there a way to give a different value of a to add, so that, something 
 like this happens:
 
 (let ((a 100) ) (add 10) )
 110
 
 Daniel
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users


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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread Dan Leslie

Oh you just had to be different. ;)

The related SRFI is withdrawn, is it safe to assume that fluid-let will 
be available outside of Chicken?


-Dan

On 6/26/2013 2:56 PM, Kon Lovett wrote:

See http://api.call-cc.org/doc/chicken/special-forms#def:fluid-let

#;1 (define a 1)
#;2 (define (add x) (+ x a) )
#;3 (let ((a 100) ) (add 10) )
11
#;4 (fluid-let ((a 100) ) (add 10) )
110


On Jun 26, 2013, at 2:47 PM, Daniel Ajoy da.a...@gmail.com wrote:


add binds a to 1 at the moment of definition.

#;48 (define a 1)
#;49 (define (add x) (+ x a) )
#;50 (add 10)
11
#;51 (let ((a 100) ) (add 10) )
11

Is there a way to give a different value of a to add, so that, something like 
this happens:

(let ((a 100) ) (add 10) )
110

Daniel

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


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



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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread Kon Lovett
Sadly, John Cowan's fine table of SRFI support by implementation doesn't cover 
SRFI 15.

In practice real dynamic variables - parameters - are the way to go for library 
or other distributed code.  they are in R7RS!

On Jun 26, 2013, at 3:01 PM, Dan Leslie d...@ironoxide.ca wrote:

 Oh you just had to be different. ;)
 
 The related SRFI is withdrawn, is it safe to assume that fluid-let will be 
 available outside of Chicken?
 
 -Dan
 
 On 6/26/2013 2:56 PM, Kon Lovett wrote:
 See http://api.call-cc.org/doc/chicken/special-forms#def:fluid-let
 
 #;1 (define a 1)
 #;2 (define (add x) (+ x a) )
 #;3 (let ((a 100) ) (add 10) )
 11
 #;4 (fluid-let ((a 100) ) (add 10) )
 110
 
 
 On Jun 26, 2013, at 2:47 PM, Daniel Ajoy da.a...@gmail.com wrote:
 
 add binds a to 1 at the moment of definition.
 
 #;48 (define a 1)
 #;49 (define (add x) (+ x a) )
 #;50 (add 10)
 11
 #;51 (let ((a 100) ) (add 10) )
 11
 
 Is there a way to give a different value of a to add, so that, something 
 like this happens:
 
 (let ((a 100) ) (add 10) )
 110
 
 Daniel
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users
 


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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread John Cowan
Dan Leslie scripsit:

 The related SRFI is withdrawn, is it safe to assume that fluid-let
 will be available outside of Chicken?

The implementation of fluid-let is trivial, provided you don't have
more than one thread to deal with.  That's why they were withdrawn,
bad behavior when multiple threads are involved.  Parameters have
their own problems, especially when mutated rather than rebound,
but they're an advance on fluid-let.

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
Micropayment advocates mistakenly believe that efficient allocation of
resources is the purpose of markets.  Efficiency is a byproduct of market
systems, not their goal.  The reasons markets work are not because users
have embraced efficiency but because markets are the best place to allow
users to maximize their preferences, and very often their preferences are
not for conservation of cheap resources.  --Clay Shirky

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


Re: [Chicken-users] dynamic scoping

2013-06-26 Thread John Cowan
Kon Lovett scripsit:

 Sadly, John Cowan's fine table of SRFI support by implementation
 doesn't cover SRFI 15.

When I did it, I wasn't dealing with withdrawn SRFIs.  As I just said,
fluid-let's definition is highly portable in a single-threaded context.

 In practice real dynamic variables - parameters - are the way to go
 for library or other distributed code.  they are in R7RS!

Yes, indeed.  Also unlike fluid-let, parameters are first class objects.

-- 
With techies, I've generally found  John Cowan
If your arguments lose the first round  http://www.ccil.org/~cowan
Make it rhyme, make it scan co...@ccil.org
Then you generally can
Make the same stupid point seem profound!   --Jonathan Robie

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