Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!crdgw1!camelback!volpe From: volpe@camelback.crd.ge.com (Christopher R Volpe) Newsgroups: comp.lang.c Subject: Re: Expressions in initializers Message-ID: <17294@crdgw1.crd.ge.com> Date: 4 Mar 91 21:14:29 GMT References: <17270@crdgw1.crd.ge.com> <760@ajpo.sei.cmu.edu> <1991Mar4.144939.8311@ux1.cso.uiuc.edu> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@camelback.crd.ge.com (Christopher R Volpe) Lines: 19 In article <1991Mar4.144939.8311@ux1.cso.uiuc.edu>, mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes: |>sqrt(2.0) is an expression. It CAN be evaluated at compile time. Perhaps |>some people don't want to write compilers that do that (i.e. they are too |>lazy), but it most certainly CAN be evaluated. "The square root of two" can be evaluated at compile time, but "sqrt(2.0)" is an invocation of a function. How is the compiler supposed to know what sqrt is? I could have in another file: double sqrt(double x) { return x - 1.0; } ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com