Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!samsung!crackers!jjmhome!smds!sw From: sw@smds.UUCP (Stephen E. Witham) Newsgroups: comp.lang.c Subject: Re: composition of functions Summary: How much better in C++ ? Keywords: composition, function, first-class object Message-ID: <324@smds.UUCP> Date: 14 Feb 91 17:12:57 GMT References: <1991Feb8.191014.6430@spool.cs.wisc.edu> <17621@gremlin.nrtc.northrop.com> Organization: SMDS Inc., Concord, MA Lines: 25 In article <17621@gremlin.nrtc.northrop.com>, kkenny@wind.nrtc.northrop.com (Kevin B. Kenny KE9TV) writes: > Reading all the flamage about composable functions, I am forced to > note that everyone appears to agree: > (1) Functions are not first-class objects in C > (2) Composition is a difficult notion to express in C. > The disagreements are on the subject of whether this problem is a > major failing in the language. I don't agree with number two. I think composing functions in C is pretty easy and useful. In fact, I think quite a few others either know this or would grudgingly admit it, or suspect that it's true. But the religious fervor is concentrated on the "first-classness" issue. The problems with doing it in C center around: o Composing functions that take and return more than one type. o The impossibility of using composed functions interchangeably with regular C functions. o The fact that you have to take care of deallocating things. My impression from your posting is that C++ can do this stuff a little more easily than C, but that it still has these problems. But I can't read C++, so could you comment on these particular thorns? --Steve Witham Not-the-fault-of: SMDS, Inc., Concord, MA