Re: A proposal for attribute lookup failures

2007-11-18 Thread MonkeeSage
On Nov 18, 5:59 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > No need to excuse. I think Ruby provides a nice context for discussing > the semantics of top level "open classes". But I think those are > entirely different than your contextual bindings. Note I find your > proposal somewhat confusing

Re: A proposal for attribute lookup failures

2007-11-18 Thread Kay Schluehr
On 19 Nov., 00:02, MonkeeSage <[EMAIL PROTECTED]> wrote: > Ps. Just for kicks, here is a simple ruby 1.8 mock-up of the proposal > (sorry for using ruby, but I don't know enough C to start hacking the > CPython backend; I think that a higher-level example is conceptually > clearer anyhow). No need

Re: A proposal for attribute lookup failures

2007-11-18 Thread MonkeeSage
Ps. Just for kicks, here is a simple ruby 1.8 mock-up of the proposal (sorry for using ruby, but I don't know enough C to start hacking the CPython backend; I think that a higher-level example is conceptually clearer anyhow). Reference cycles are not detected in the example. #!/usr/bin/ruby class

Re: A proposal for attribute lookup failures

2007-11-18 Thread MonkeeSage
On Nov 18, 5:27 am, James Stroud <[EMAIL PROTECTED]> wrote: > It would be unoriginal of me to suggest that this violates the explicit > is better than implicit maxim. But it does. That's what I meant about hiding the complexity of an attribute failure. Though, sometimes implicit is acceptable (e.

Re: A proposal for attribute lookup failures

2007-11-18 Thread Arnaud Delobelle
On Nov 18, 4:07 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > Proposal: > > When an attribute lookup fails for an object, check the top-level > (and local scope?) for a corresponding function or attribute and apply > it as the called attribute if found, drop through to the exception > otherwise. Th

Re: A proposal for attribute lookup failures

2007-11-18 Thread James Stroud
MonkeeSage wrote: > Proposal: > > When an attribute lookup fails for an object, check the top-level > (and local scope?) for a corresponding function or attribute and apply > it as the called attribute if found, drop through to the exception > otherwise. This is just syntactic sugar. > > > Exa

A proposal for attribute lookup failures

2007-11-17 Thread MonkeeSage
Proposal: When an attribute lookup fails for an object, check the top-level (and local scope?) for a corresponding function or attribute and apply it as the called attribute if found, drop through to the exception otherwise. This is just syntactic sugar. Example: a = [1,2,3] a.len() #