chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Re: tcp-read-timeout: procedure or parameter?


From: Alex Sandro Queiroz e Silva
Subject: Re: [Chicken-users] Re: tcp-read-timeout: procedure or parameter?
Date: Wed, 25 Jun 2008 11:47:18 -0300
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Hallo,

William Xu wrote:
Alex Sandro Queiroz e Silva <address@hidden> writes:

     <body> may call procedures that have a tcp-read-timeout free
variable, but due to lexical scope that variable will most certainly not
be bound to the one you want. For this you need dynamic scope.

Do you mean something like the procedure `foo' call here?
    (define radix (make-parameter 10))
(define (foo)
      (radix))
(parameterize
     ((radix 8))
     (foo))

But the (foo) call is still bounded by (radix 8), hence the result is
still 8 ?

In this case foo sees the right radix variable, which is bound to a parameter, due to lexical scoping. But inside the parameterize block, that very same parameter will return a different value, acting like a dynamically bound variable.

-alex
http://www.ventonegro.org/




reply via email to

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