1. Ten Modules or Less == Using Namespaces
- Posted by _tom (admin) Sep 19, 2013
- 1409 views
A suggested design for those that want to program by including a single, monolithic, monster, module. You can create an include file that includes all other includes.
A practical design ends up with ten modules. This is based on the organization the developers used in creating the Standard Library.
This is all described in the wiki:
http://openeuphoria.org/wiki/view/Modules.wc
Yes, you will have to use namespace prefixes to make things work. I do not believe this is much of a burden since namespace prefixes can be ignored in most programs and freely altered. In an OO-style language you must always use a class prefix . In a hardwired scheme you must always type the required prefixes. The O[ design requires less typing and is very flexible.
_tom
2. Re: Ten Modules or Less == Using Namespaces
- Posted by mattlewis (admin) Sep 19, 2013
- 1396 views
A suggested design for those that want to program by including a single, monolithic, monster, module. You can create an include file that includes all other includes.
A practical design ends up with ten modules. This is based on the organization the developers used in creating the Standard Library.
This is all described in the wiki:
Hmm...I don't think this is particularly useful (compared to the actual organization of the library ), but I would have thought that primes.e would fit better into the math bundle than data. I suppose it went into data since it's used by map.e?
Matt
3. Re: Ten Modules or Less == Using Namespaces
- Posted by _tom (admin) Sep 19, 2013
- 1379 views
I copied the module organization from a manual.af file (which may be an old version by now.)
I welcome suggestions on how to better organize this suggested module organization. It also needs testing to see if it is really practical.
Hopefully something like this can be designed to make it simpler for newcomers to O[ to adapt to our ways.
An "official" organization will probably not please everyone which is why I want to emphasize: roll your own.
_tom
4. Re: Ten Modules or Less == Using Namespaces
- Posted by ghaberek (admin) Sep 19, 2013
- 1384 views
I don't think this is particularly useful.
Agreed. I think it's important to understand what-comes-from-where. Abstracting the include files in the manner leaves programmer "blind" as to where things are located.
What we really need is a good syntax-highlighting editor that can suggest what to include when it cannot find an function, type, or constant. Hey, wasn't I working on that? Yeah, I haven't been lately.
-Greg
5. Re: Ten Modules or Less == Using Namespaces
- Posted by mattlewis (admin) Sep 19, 2013
- 1388 views
What we really need is a good syntax-highlighting editor that can suggest what to include when it cannot find an function, type, or constant. Hey, wasn't I working on that? Yeah, I haven't been lately.
You're absolutely right. I use this all the time with java in Eclipse. Hmm...I think I already have most of what I need coded into wxIDE to do this.
Matt
6. Re: Ten Modules or Less == Using Namespaces
- Posted by EUWX Sep 19, 2013
- 1386 views
A suggested design for those that want to program by including a single, monolithic, monster, module. You can create an include file that includes all other includes.
A practical design ends up with ten modules. This is based on the organization the developers used in creating the Standard Library.
This is all described in the wiki:
http://openeuphoria.org/wiki/view/Modules.wc
Yes, you will have to use namespace prefixes to make things work. I do not believe this is much of a burden since namespace prefixes can be ignored in most programs and freely altered. In an OO-style language you must always use a class prefix . In a hardwired scheme you must always type the required prefixes. The O[ design requires less typing and is very flexible.
_tom
I am glad you have taken the right direction