Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!att!linac!uwm.edu!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.misc Subject: Re: On whether C has first-class composable functions Message-ID: <7027:Feb906:42:0991@kramden.acf.nyu.edu> Date: 9 Feb 91 06:42:09 GMT References: <1991Feb7.150537.9257@spool.cs.wisc.edu> <25199:Feb801:33:1191@kramden.acf.nyu.edu> <1991Feb8.201117.7515@spool.cs.wisc.edu> Organization: IR Lines: 115 In article <1991Feb8.201117.7515@spool.cs.wisc.edu> quale@picard.cs.wisc.edu (Douglas E. Quale) writes: > In article <25199:Feb801:33:1191@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > >In article <1991Feb7.150537.9257@spool.cs.wisc.edu> quale@picard.cs.wisc.edu (Douglas E. Quale) writes: > >> Unfortunately, this doesn't solve the problem. Your `functions' are not > >> functions. What happens when I pass a Bernstein `function' to twalk(3c)?? > >``Unfortunately, your bignum package doesn't solve the problem. Your > >`bignums' are not numbers. What happens when I pass a DECWRL bignum to > >getcwd()??'' [ etc. ] > Number, bignum and integer are not C types. int is a C type. Quite right. My struct funs are not C types. ``foo (*)()'' is a C type. Nevertheless, bignums are perfectly valid integral types, just as struct funs are perfectly valid function types. You seem to be confusing normal definitions (and common sense) with words that a few people decided to use in a language definition. They also defined these things called ``phases of translation''; will you no longer be able to use that phrase outside an ANSI C context? You'll be in real trouble when you read two standards that use the same words in different ways. > int (*compose)(int (*f)(int), int (*g)(int)) > We have a valid C type for compose, why can't we use it? ``unsigned char jn(unsigned char c)'' ``We have a valid C type for Bessel functions, why can't we use it?'' > "Anything supporting certain operations etc." gives you two incompatible > classes of ``functions.'' Boo hoo. long and short are two incompatible classes of ``integral types.'' > In any case, why is this crap necessary? Why can't the > output of one invocation of compose be used an argument to another compose? Wtf are you talking about? All seven working implementations I've seen here allow nested composition. [ the same old arguments ] Doug, WE HAVE FINISHED DISCUSSING THIS. You are the only person who publicly claims to have been listening since the beginning of this discussion and who doesn't understand the issues at this point. > A) Dynamic allocation is a source of expressive power in a language. > Dan said this once and I agree. We are together at point A. No, I have never said that. Dynamic allocation is a source of *semantic* power, not necessarily syntactic power. You are confused. > B) First-class status requires that dynamic allocation be possible. > I think I probably lose Dan between point A and point B. Yes. First-class (as traditionally defined) does not imply dynamically allocatable. > C) C functions are not dynamically allocable. > Dan has repeatedly denied C. No, I have never denied that statement. You are lying. > The only proof he can offer is to redefine > function. You are lying. > Actually I am getting used to Dan redefining terms in the CS > lexicon whenever his opponent gets the upper hand in an argument. Oh? What terms have I redefined? I define terms now and then when I cannot find any established terms with the right definition. But I have never redefined words already used in the same context. You are confused. > To me, "C functions are not dynamically allocable" > and "C doesn't have dynamically allocable functions" have identical > meaning, Then you don't know how to use the English language. (But we've established that already.) Hint: What does the first statement have in common with ``Have you stopped beating your wife?'' > Dan is a math genius Doubtful. > who can't learn anything a mere book, I can't parse that phrase. > A great advantage of languages with first-class functions over languages > like C is that it is unnecessary to use Newspeak and call struct bletch > a function. Oh, gee, this matters sooooo much to real programmers! > For some reason, Dan is insanely protective of C, like a mother for her > child. C is 20 years old, and the state of the art in programming > languages has improved somewhat since then. Dan should learn a non-Algol > language before proclaiming himself an expert on programming languages. I have never proclaimed myself an expert on programming languages. I have written nontrivial programs in several languages not derived from Fortran. I have even told you that I know one of those languages. All we can conclude is that you intend to be insulting. Doug, you are contributing absolutely nothing to the discussion. All you're doing is throwing out random insults. (If someone other than Doug can see any point he's brought up that hasn't been thoroughly discussed before in these threads, please let me know.) Go away. ---Dan