Re: Namespaces
- Posted by irv mullins <irvm at ellijay.com> Jun 09, 2004
- 653 views
Kat wrote: > I don't remember who asked for namespaced functions, but i was prolly the > first to ask for namespaced vars, for access to the name list of vars, for > ability to build var-names in the program dynamically, and for a trap to know > when a var was changed and to execute code at that time. For now, anyone > wanting to do these things needs to use associated lists. Speaking of variables, namespacing (as implemented) does absolutely nothing to help the following type of situation:
-- Customer file: global object rec global constant NAME = 1, ADDR = 2, CITY = 3, STATE = 4 rec = {"Coyote, W.","55 Fifth St.","Tucson","AZ"} -- Supplier file: global sequence rec global constant NAME = 1, STATE = 2 rec = {"Acme Anvils, Inc.","PA"} -- Main program: include customer.e as customer include supplier.e as supplier printf(1,"Name:%s, State:%s\n", {customer:rec[customer:NAME], customer:rec[customer:STATE]})
Anyone else note a great duplication of effort here? How do you get the same result without qualifying every instance of NAME and STATE? Anyone remember how easily that was done with ancient Pascal? Irv