Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!wuarchive!swbatl!uucibg From: uucibg@swbatl.UUCP (3929) Newsgroups: comp.lang.eiffel Subject: Re: Problem with semantics of 'put' in Eiffel library class LINKED_LIST Message-ID: <1127@swbatl.UUCP> Date: 22 Jan 90 15:08:13 GMT References: <1749@novavax.UUCP> <237@eiffel.UUCP> Reply-To: uucibg@swbatl.UUCP (Brian Gilstrap - UCI - 5-3929) Organization: Southwestern Bell Tele. Co. - Advanced Technology Lab - St. Louis Lines: 50 In article <237@eiffel.UUCP> bertrand@eiffel.UUCP (Bertrand Meyer) writes: >In <1749@novavax.UUCP>, weiner@novavax.UUCP (Bob Weiner) suggests changing >the semantics of ``put'' in the list classes of the Data Structure >library. The effect would be the same as that of ``put_left''. >The referenced message only talks about LINKED_LIST but of >course the same change would have to be made to other list >classes as well. > >I am somewhat puzzled by the suggestion: > >- Why choose the semantics of put_left rather than that of put_right? Good point. >- Since we already have put_left, why have another procedure which has >a different name and the same effect? Although synonyms may make sense >in some cases, basic libraries should be both complete and minimal >(``the relevant features, all the relevant features, nothing but the >relevant features''). The feature name set should be minimal too. Also a good point. >- An operation such as the one currently called ``put'' will be needed >anyway. After changing the semantics of the current ``put'', we would >reintroduce a routine with the old semantics and another name! True. >I have argued in this newsgroup and elsewhere that one should not >be afraid of change if it is carried out professionally and responsibly. >But this applies to change that is needed. In this particular case, >I can't see anything wrong with the current status of put, put_left >and put_right. For me (someone who has never used Eiffel; I hope to change that in the near future), the problem lies in "semantic distance" versus "functional distance". In this case, we have three routines which have the same semantic root (the verb "put"), but one of them behaves in a fundamentally different manner. I would argue for changing the name of "put" to "replace" and leaving it at that. This preserves the "features, needed features, and nothing but the needed features" issue. It also places some semantic "distance" between the routines which will hopefully help the class automatically document itself (well, we all know that is tough, but this would help). For me, it certainly helps to re-inforce the fact that the routines behave differently. Of course, there's probably some good reason why this won't work... :-) >-- Bertrand Meyer >bertrand@eiffel.com Just thought the viewpoint of a neophyte might be interesting... Brian Gilstrap ( uucibg@swbatl.UUCP )