Re: the annoying, verbose self



MonkeeSage wrote:
The issue of lexical scope still looms large on the horizon. How does
one distinguish between attributes (as scoped by the "with" clause),
local/global variables, and function/method calls? There doesn't seem
to be an easy way. You'd need multiple passes over the data to
determine various scopes -- and for what, to save typing a few
characters? And even if implemented, it would mean hiding the
complexity of the resolution, which is not a good thing.

Regards,
Jordan

Does this address your concerns?

The idea being that "with self" use
creates a new namespace:
newGlobal= oldGlobal + oldLocal
newLocal= names from self

Similarly, "with math" creates a newer
namespace:
newerGlobal= newGlobal + newLocal
newerLocal= names from math

My guess is that there would be little
use for nesting the
"with".


Colin W.

.



Relevant Pages

  • Re: Hypothetical: All code in classes but main()
    ... >>gain access to member data and potentially become bound to it. ... >>the argument Stroustrup gives for having helper functions at namespace ... I have heard some Java wags claim that for performance ... Then I click on the "math" namespace, and the box refreshes, now ...
    (comp.lang.cpp)
  • Re: Hypothetical: All code in classes but main()
    ... the argument Stroustrup gives for having helper functions at namespace ... If a function requires access to member data, then by all means make it ... > There are advantages to having the static Math class in Java. ...
    (comp.lang.cpp)
  • Re: Hypothetical: All code in classes but main()
    ... > all data members, if it needs to access private and protected instance ... > the use of public data members in good OO design. ... > namespace math in a namespace top? ...
    (comp.lang.cpp)
  • Re: Syntax, expressiveness and the beauty of Tcl
    ... Tcl is similar regarding prefix operators. ... I think having the math operators in their own namespace is a great ... because generally the [expr] command does ...
    (comp.lang.tcl)
  • Is there nealy same module? ExportTo
    ... I have one module my calling ExportTo. ... ExportTo - export function/method to namespace ... sub function1{... ...
    (comp.lang.perl.modules)