Re: reading strings from terminal and writing them to a file



On Mar 31, 11:01 am, pereges <Brol...@xxxxxxxxx> wrote:

Are there any advantages of using let over setf ?

<http://en.wikipedia.org/wiki/Scope_(programming)
#Static_versus_dynamic_scoping>

a partial quote referring to lexical scope (i.e., let, not setf):

"Because matching a variable to its binding only requires analysis of
the program text, this type of [static] scoping is sometimes also
called lexical scoping. Static scope is standard in modern functional
languages such as ML and Haskell because it allows the programmer to
reason as if variable bindings are carried out by substitution. Static
scoping also makes it much easier to make modular code and reason
about it, since its binding structure can be understood in isolation.
In contrast, dynamic scope forces the programmer to anticipate all
possible dynamic contexts in which the module's code may be invoked."
.



Relevant Pages

  • Re: dynamic scope
    ... variable takes a long time because you have to look in all those frames along ... With lexical scope the ... So, if you're going to have lexical scope, just use deep binding. ...
    (comp.lang.logo)
  • Of closures and expressing anonymous functions [Was: Re: Securing a future for anonymous functions i
    ... Allowing write access to variables in a closed-over lexical scope ... global scope or from local scope, with default from lexical scope. ... you want to explicitly hide an outer binding, ... Sound stupid? ...
    (comp.lang.python)
  • Re: A question about lexical binding
    ... from SICP uses a deep binding environment. ... However, deep binding has the problem that depending upon the caller, ... Whether you get lexical or dynamic scope depends on how you terminate the ... toplevel frame, you have lexical references; ...
    (comp.lang.lisp)
  • Re: Scope and program structure problems
    ... then I'd be declaring the variables/objects explicitly ... I personnally find the assignment, import, class and def statements (all having a binding behaviour) to be rather explicit. ... their scope according to how/where they were declared. ... Names bound within a class statement lives in the class's namespace ...
    (comp.lang.python)
  • Re: Aggregation vs composition
    ... which is indeed something a programmer has to be aware of. ... >> with a dead reference. ... > That is where the true lifetime responsibility lies... ... and there is no risk of B going out of scope before C wants this to happen. ...
    (comp.object)