Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!uwvax!picard.cs.wisc.edu!quale From: quale@picard.cs.wisc.edu (Douglas E. Quale) Newsgroups: comp.lang.misc Subject: Re: On whether C has first-class composable functions Message-ID: <1991Feb11.160735.9458@spool.cs.wisc.edu> Date: 11 Feb 91 16:07:35 GMT References: <25199:Feb801:33:1191@kramden.acf.nyu.edu> <1991Feb8.191014.6430@spool.cs.wisc.edu> <6828:Feb906:14:3491@kramden.acf.nyu.edu> Sender: news@spool.cs.wisc.edu (The News) Organization: U of Wisconsin CS Dept Lines: 33 In article <6828:Feb906:14:3491@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >I never said that those expressions were nonsensical. Your implication >is a lie, plain and simple. I doubt you have the integrity to review the >articles and apologize, but I'll give you one chance to do so before I >start quoting things in public. > Quote away, Dan. I'm not afraid of the truth. >> Instead of continually saying it's trivial, post your compose code in C and >> then we'll see how it stacks up. > >I did. Since you apparently would rather flame than think, here's the >three-way composition that you claim to be so difficult. I've written it >out step-by-step and put in comments just for you. > > compose(square,square,sqsq) /* put square o square in sqsq */ > compose(square,sqsq,sqsqsq) /* put square o sqsq in sqsqsq */ > printf("%d\n",apply(sqsqsq,2)); /* apply sqsqsq to 2 and print it */ > >Exercise: write the missing struct fun definitions and initializations. > >---Dan Dan, this is your job, not mine. I say it can't be done. int square(int x) { return (x*x) } is easy enough, but I can't get the rest to work. How about helping me out? -- Doug Quale