Re: Using include and namespaces
- Posted by kbochert at copper.net Aug 15, 2002
- 600 views
-------Phoenix-Boundary-07081998- You wrote on 8/14/02 10:28:10 PM: > 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 =3D Open:pop() > Y =3D Close:pop() > >If this would work in Euphoria I would be very happy, but it doesn't. Second >include file is just ignored. (Or does it=3F=3F :\) How about making a copy of heap.e and naming it heap2.e =3F then: include heap.e as Input include heap2.e as Output Along the same lines, how about: include sort.e as EU -- normal sort function EUcompare(object a, object b) -- save eu's compare if needed return compare (a, b) end function function compare (object a, object b) -- my custom compare .... end function include sort1.e as Custom -- sort uses custom compare Karl Bochert -------Phoenix-Boundary-07081998---