Re: Packages

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jason Gade wrote:
> 
> CChris wrote:
> > 
> > Jason Gade wrote:
> > > 
> > > CChris wrote:
> > > > 
> > > > jacques deschĂȘnes wrote:
> > > > > 
> > > > > Your system is too complex, it add a lot of new keywords. Why make it
> > > > > complex
> > > > > when one can make simple.
> > > > 
> > > > Because simple systems won't work.
> > > > They will create issues of their own, out of short-sightedness.
> > > 
> > > Surely you're joking?
> > > 
> > > And in a different thread:
> > > 
> > > > We seem to live on different planets.
> > > 
> > > True.
> > > 
> > 
> > I agree. But some aspect of your planet are causing serious trouble to my
> > coding.
> > 
> > > Here's my proposal, one new keyword, but I don't know if it is possible:
> > > import <lib> [as <namespace>]
> > > 
> > > This works just like include but globals included or imported by imported
> > > files
> > > are no longer visible. It acts as a block to global namespace pollution.
> > > 
> > > Basically it only imports symbols defined in <lib>, not symbols defined in
> > > <lib>'s
> > > includes or imported files. Those go... somewhere else.
> > > 
> > 
> > in my_app.exw:
> > import my_lib.e
> > 
> > in my_lib.e
> > include get.e
> > 
> > Can my_app.exw access routines in get.e?
> > 
> > If so:
> > 
> > in my_lib.e:
> > global function my_func()
> > import my_utils.e
> > 
> > in my_utils.e:
> > x=my_func()
> > 
> > 1/ Is the above call valid?
> 
> On further consideration this should break. Include should treat files as
> text,
> import should treat files as modules and work one way.
> 

It shouldn't. Submodules need - most of the time - to call some central routine
in the file that includes them. It really would be a terribly useless, harmful
regression if this started to no longer work.

> > 2/ What happens if my_app.exw also defines a global my_func(), and some
> > other
> > file calls that global?
> 
> It depends if the other files are linked with include or import.
> 

Oh, how is this related to goto? And who is Shirley?

Don't you think your approach will make placement of routines even more a
nightmare than it currently is? Not only you have to deal with define_before_use,
but now you'd add define_before_import or somesuch. Cant believe it.

CChris

> --
> "Any programming problem can be solved by adding a level of indirection."
> --anonymous
> "Any performance problem can be solved by removing a level of indirection."
> --M. Haertel
> "Premature optimization is the root of all evil in programming."
> --C.A.R. Hoare
> j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu