Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!samsung!rex!uflorida!novavax!weiner From: weiner@novavax.UUCP (Bob Weiner) Newsgroups: comp.lang.eiffel Subject: Problem with semantics of 'put' in Eiffel library class LINKED_LIST Message-ID: <1749@novavax.UUCP> Date: 19 Jan 90 23:30:19 GMT Organization: Motorola Inc. Lines: 24 This note refers to V2.2B of ISE's Eiffel libraries. I have a problem with the semantics of the LINKED_LIST 'put' operation. I believe they should be different. Specifically, a list put should be an insertion rather than a replacement operation as it presently is. (Presently 'put_left' and 'put_right' must be used for insertion.) I propose that 'put' should be the same as 'put_left' and the operation that 'put' now performs should be renamed 'replace' for clarity. Any housewife or professional programmer knows that putting something into a list does not eliminate any of the other list items, hence the need for the change. Additionally, the current semantics conflicts with the 'put' of SORTED_LIST which is an insert operation. ARRAY put operations do replace the item indexed in the array but this is what one would naturally expect and bears no relation to the best semantics for a LIST put. I am very surprised that no one else has mentioned this but I think it is important since programmers can too easily overrite LIST elements. -- Bob Weiner, Motorola, Inc., USENET: ...!gatech!uflorida!novavax!weiner (407) 364-2087