Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!nikhefh!a38 From: a38@nikhefh.nikhef.nl (James Barr) Newsgroups: comp.lang.eiffel Subject: A question on generic parameters Message-ID: <1203@nikhefh.nikhef.nl> Date: 11 Apr 91 09:53:25 GMT Sender: a38@nikhef.nl (James Barr) Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 38 Hi, please excuse any niavity in this question as I've only spent a few days on Betrand Meyers book O.O. Software Construction. I noticed that you could only do the bare minimum of operations on generic class parameters, which seemed a bit limiting. In the case of an ordered list class you would need a class parameter that could support a comparision function, but there seems no way of doing this. I would very much appreciate an explanation of how you would avoid this or if in fact it is a non-problem. If it is a limitation I thought maybe an extension that could specify the heir of the generic class. So that all operations performable on the heir would also be available on instances of the generic class parameter. eg. class OrderedList [T heir of Ordered] ... deferred class Ordered -- make this an heir of any class/type whose instances/values -- can be ordered. export compare; compare (a,b : Ordered) : Boolean ... Regards, James -- James Barr ............... ...... +31 20-592-5104 ........... .......... James.Barr@nikhef.nl ...... .............. NIKHEF, Kruislaan 409, 1009DB Amsterdam .. ..................