Re: Using include and namespaces
- Posted by 10963508 at europeonline.com Aug 15, 2002
- 628 views
----- Original Message ----- From: <OthelloVivaldi at hotmail.com> > My current solution is therefore to use the include ... as feature. > > For example, to implement the typical a* routine, you will need > two heaps, which are often given the names 'open' and 'close'. > So the question is: what do you think about the following: > > include heap.e as Open > include heap.e as Close > > Open:push(X) > Close:push(Y) > X = Open:pop() > Y = Close:pop() > > Would you recommend this kind of programming style? > Is there some horrible way this can backfire or otherwise > turn out to be a member of the set of bad things? If this would work in Euphoria I would be very happy, but it doesn't. Second include file is just ignored. (Or does it?? :\) This is my number one wish item for any Euphoria feature (second are structures). That each include file has instance in memory, like a class. Now for every library which will have more than one object in program you have to keep id for each object of library and have global sequences in library file and access properties of objects from those global sequences and with id of object. This slows down coding time, clarity of code is reduced and also speed of program is slower I imagine.