Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Pure Functions (was Re: C optimizer) Message-ID: <1989Feb17.165931.3920@utzoo.uucp> Organization: U of Toronto Zoology References: <1398@quanta.eng.ohio-state.edu> <2008@goofy.megatest.UUCP> <50915@yale-celray.yale.UUCP> Date: Fri, 17 Feb 89 16:59:31 GMT In article <50915@yale-celray.yale.UUCP> wald-david@CS.YALE.EDU (david wald) writes: >... we still need a way to describe the difficulty with >treating sleep() as a pure function... This seems trivial: sleep() invokes at least one system call, which in turn is not a pure function. If you take a purist viewpoint, this doesn't help, because one then has to figure out how to tell the compiler that the system call is not a pure function. If you take a pragmatic viewpoint, however, there *has* to be a way to say such things anyway, because it's grossly unrealistic to assume that compiled code will never need to talk to "black box" library functions whose innards are not known to the compiler. There has to be a way to specify just the external behavior, e.g. pureness or non-pureness. -- The Earth is our mother; | Henry Spencer at U of Toronto Zoology our nine months are up. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu