Xref: utzoo comp.lang.c:36509 comp.lang.functional:652 comp.theory:1580 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!samsung!uunet!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!sane From: sane@cs.uiuc.edu (Aamod Sane) Newsgroups: comp.lang.c,comp.lang.functional,comp.theory,aus.flame Subject: Re: function composition in C Message-ID: <1991Feb25.234541.16809@m.cs.uiuc.edu> Date: 25 Feb 91 23:45:41 GMT References: <6873@munnari.oz.au> Sender: news@m.cs.uiuc.edu (News Database (admin-Mike Schwager)) Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL Lines: 29 aet@felix.ee.mu.OZ.AU (bert) writes: > Does anyone know how to write a compose function in C, >without writing a Scheme interpreter to do it in. >A call should look something like this: > (compose(sqr,cube)) (2) >which would evaluate to 64. > "compose" is a one-liner in any functional language, >but I suspect that it is, given the above constraint, impossible in C. >(then again, I'm just an undergrad, so what would I know :-) > Feel free to use pointers wherever they seem appropriate. > (so the above call could look like: > (*compose(&sqr,&cube)) (2) ) > Many thanks for everyone's helpful comments! > Bert Thompson. Write to comp.lang.misc. There was recently a major war on this.. -- sane@cs.uiuc.edu == / \ ----- == * \_/ -|||- == Brought to you by Super Global Mega Corp .com