Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!think!yale!cs.yale.edu!news From: news@cs.yale.edu (Usenet News) Newsgroups: comp.lang.eiffel Subject: Quicksort? (was Re: Coping with failure) Message-ID: <17412@cs.yale.edu> Date: 1 Mar 90 00:42:34 GMT References: <25EB6B0D.2249@maccs.dcss.mcmaster.ca> <1880@clyde.concordia.ca> Reply-To: jellinghaus-robert@yale.UUCP Organization: Yale University Computer Science Dept, New Haven CT 06520-2158 Lines: 27 In article <1880@clyde.concordia.ca> marcap@hercule.CS.Concordia.CA (PAWLOWSKY marc) writes: >consuming. For example I just wrote a class to perform quick_sort. The >properly check that the procedure has worked it is necessay to check >that the cardinality is still the same, all objects that entered the array >exit the array, the output is sorted. When an object is "put" into a >structure it should also be checked that the object is in the structure. I would expect that the postconditions for the standard Eiffel library would include assertions to perform the checking you describe (such assertions do seem like a good idea), but upon examination I see they don't. I wonder why not? They wouldn't be compiled into the libraries as distributed, and they would provide good examples of correct assertion writing. On another note, would it be possible for you to post your quicksort class? At what level of the library does it operate? I for one hope that such classes become more common. I like the Eiffel implementations of standard computer science data structures, but classes implementing standard CS _algorithms_ seem a bit further behind. They could be every bit as helpful, though.... >Marc Pawlowsky Grad Student Concodia University Rob Jellinghaus | "Next time you see a lie being spread or a jellinghaus-robert@CS.Yale.EDU | bad decision being made out of sheer ignor- ROBERTJ@{yalecs,yalevm}.BITNET | ance, pause, and think of hypertext." {everyone}!decvax!yale!robertj | -- K. Eric Drexler, _Engines of Creation_