Xref: utzoo comp.lang.eiffel:1617 comp.object:3651 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!nntpd.lkg.dec.com!tkou02.enet.dec.com!jit533!diamond From: diamond@jit533.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.lang.eiffel,comp.object Subject: Re: Functions without side effects (was Old confusion) Message-ID: <1991Jun5.083241.13145@tkou02.enet.dec.com> Date: 5 Jun 91 08:32:41 GMT References: <130242@tut.cis.ohio-state.edu> <1991Jun5.072556.19870@irisa.fr> Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) Followup-To: comp.lang.eiffel,comp.object Organization: Digital Equipment Corporation Japan , Tokyo Lines: 24 In article <1991Jun5.072556.19870@irisa.fr> jezequel@irisa.fr (Jean-Marc Jezequel) writes: >Let me summarize even further: It seems that we all agree on: >1) Functions with side effects are dangerous, and don't follow the >road towards better software quality >2) Procedures which return values are often usefull > >So why not trying to make a syntatical difference between the two >concepts (keyword like "pure" for pure functions)? >I guess it is too late for Eiffel V3, but may be for V4, when we (hope >to) have tools to make static analysis of programs in order to prove >correctness of pieces of code (i.e. ensuring postconditions and >invariants from preconditions and code), and so on. There are degrees of purity. Idempotency does not imply an absence of side effects. Even a function which is "practically" "pure" should be able to signal an error handler on occasion, which is likely to cause side effects in both I/O and in the I/O support routines' knowledge of the external state. I think the keywords will have to be on the order of "idempotent" and other precise descriptions. -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it. Permission is granted to feel this signature, but not to look at it.