Re: Dynamical scoping

2008-01-15 Thread Paul Rubin
Kay Schluehr <[EMAIL PROTECTED]> writes: > On 15 Jan., 02:13, Paul Rubin wrote: > > George Sakkis <[EMAIL PROTECTED]> writes: > > > What's the best way to simulate dynamically scoped variables ala Lisp ? > > > > Ugh check the docs for the python 2.5 "with" statement,

Re: Dynamical scoping

2008-01-15 Thread Kay Schluehr
On 14 Jan., 21:17, George Sakkis <[EMAIL PROTECTED]> wrote: > What's the best way to simulate dynamically scoped variables ala > Lisp ? The use case is an open-ended set of objects that need to > access the same piece of information (e.g. a dict, a ConfigParser > object, a logger etc.). I know tha

Re: Dynamical scoping

2008-01-15 Thread Kay Schluehr
On 15 Jan., 02:13, Paul Rubin wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > > What's the best way to simulate dynamically scoped variables ala Lisp ? > > Ugh check the docs for the python 2.5 "with" statement, which > gives you sort of a programmable unwind-pro

Re: Dynamical scoping

2008-01-14 Thread Paul Rubin
George Sakkis <[EMAIL PROTECTED]> writes: > What's the best way to simulate dynamically scoped variables ala Lisp ? Ugh check the docs for the python 2.5 "with" statement, which gives you sort of a programmable unwind-protect (more powerful than try/except). You'd have an environment diction

Dynamical scoping

2008-01-14 Thread George Sakkis
What's the best way to simulate dynamically scoped variables ala Lisp ? The use case is an open-ended set of objects that need to access the same piece of information (e.g. a dict, a ConfigParser object, a logger etc.). I know that the "proper" OO and functional way is to pass the information expl