Pure Functions (was Re: C optimizer)

Henry Spencer henry at utzoo.uucp
Sat Feb 18 02:59:31 AEST 1989


In article <50915 at yale-celray.yale.UUCP> wald-david at 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 at zoo.toronto.edu



More information about the Comp.lang.c mailing list