🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2740

Re: On whether C has first-class composable functions

#2740
From: Dan Bernstein
Date: Tue, 05 Feb 1991 20:27
53 lines
3225 bytes
In article <1991Feb5.144815.23239@spool.cs.wisc.edu> quale@picard.cs.wisc.edu (Douglas E. Quale) writes:
> In article <29224:Feb419:06:0191@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
> >In article <1991Feb4.160639.2766@spool.cs.wisc.edu> quale@picard.cs.wisc.edu (Douglas E. Quale) writes:
> >> Dan, sometimes I think we don't speak the same language.
> >Look, static allocation is not an ``arbitrary limit,'' and when you say
> >``fixed, arbitrary limit'' people will assume that the programmer used
> >some fixed number, say 1000, as a limit. That's not true here.
> Dan, static allocation of functions is an arbitrary limit.

Arbitrary, adj. 1. Not fixed by rules but left to one's judgment or
choice; discretionary. 2. Based on one's preference, notion, whim, etc.;
capricious. 3. Absolute; despotic.

You say that there is some arbitrary limit. Do you mean that the
programmer used his judgment to choose some limit? Really? What is that
limit? 500? 1000? 7? I don't see it. The only limit is the that the
number of functions is limited to the number of functions statically
declared, and that's a rule imposed by the language. Is someone choosing
a limit capriciously, based on his preference or whim? No. The limit
isn't consciously chosen by any particular person; it's forced by the
rule of static allocation.

You might argue that the rule is arbitrary, though this seems to be a
further misuse of the language. In any case, there is no arbitrary limit
involved.

Who's not speaking the same language here?

> The *only* portable implementation of compose in C statically allocated the
> composed functions.

As I said at the beginning of this discussion, you're wrong. The very
first implementation posted (mine) dynamically allocated the composed,
first-class functions.

> If YOU have a portable implementation of compose in C that returns a
> function pointer and doesn't limit the number of composes to some compile
> time fixed number, then post it or mail it to me.

I did post it.

I question your use of ``compile-time fixed number'' to refer to static
allocation. Again, do you say that Fortran is full of arbitrary or fixed
limits because it doesn't have dynamic allocation? Of course not. Who's
being arbitrary? Who's fixing the limit? The number of statements in a
Fortran program is static, but it's not limited to any fixed or
arbitrary number. Similarly for any other static language feature.

Here's a real example of an arbitrary limit: The UNIX kernel typically
only looks at the first 32 characters in a #! script. 32 is a fixed
number which was chosen pretty much arbitrarily.

---Dan
Technical Details
Message-ID: <1234:Feb520:27:2391@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!think.com!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <1991Feb4.160639.2766@spool.cs.wisc.edu> <29224:Feb419:06:0191@kramden.acf.nyu.edu> <1991Feb5.144815.23239@spool.cs.wisc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!think.com!hsdndev!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: <1234:Feb520:27:2391@kramden.acf.nyu.edu>
Date: 5 Feb 91 20:27:23 GMT
References: <1991Feb4.160639.2766@spool.cs.wisc.edu> <29224:Feb419:06:0191@kramden.acf.nyu.edu> <1991Feb5.144815.23239@spool.cs.wisc.edu>
Organization: IR
Lines: 53