Article View: comp.lang.misc
Article #2611Re: Re^2: On whether C has first-class composable functions
From: Dan Bernstein
Date: Tue, 08 Jan 1991 00:19
Date: Tue, 08 Jan 1991 00:19
39 lines
2286 bytes
2286 bytes
In article <443@data.UUCP> kend@data.UUCP (Ken Dickey) writes:
> SCHEME also permits the treatment of functions as full flegded data
> objects; they may be passed as arguments, returned as values, made
> part of composite data structures, and notated as independent, unnamed
> ("anonymous") entities. {Contrast this with most ALGOL-like
> languages, in which a function can be written only by declaring it and
> giving it a name; imagine being able to use an integer value only by
> giving it a name in a declaration!).
``Full-fledged data objects,'' yes; but ``first-class'' doesn't mean
``full-fledged.''
> More recently, [Kent Dybvig, "The Scheme Programming Language",
> Prentice Hall, 1987]
> ...procedures are not always named. Instead, procedures are
> first-class data objects similar to strings or numbers; identifiers
> are bound to procedures in the same way they are bound to other
> objects.
Okay, that'd do it; but if that's the definition of ``first-class'' then
you can have first-class objects that you can't pass as function
arguments! I don't think any of us agree with that.
Anyone want to contribute more definitions?
> > > By the way, what function would "apply(compose(compose,f),x);" return in C?
> > > Strike "composable"?
> > What are you talking about?
[ explanation ]
Okay, you're saying that you want compose() to apply to the first
argument of a function with many arguments. This would be more useful
if you also had a way to switch around the arguments to a function---
e.g., to convert f(x,y) to g(y,x). There's no reason that these things
can't be done with exactly the same techniques as the one-argument
compose(), so I don't think your example is a reason to say that we're
not talking about composable functions.
---Dan
Technical Details
Message-ID:
<13759:Jan800:19:2391@kramden.acf.nyu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstndReferences:
<442@data.UUCP> <4408:Jan421:44:3391@kramden.acf.nyu.edu> <443@data.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.misc Subject: Re: Re^2: On whether C has first-class composable functions Message-ID: <13759:Jan800:19:2391@kramden.acf.nyu.edu> Date: 8 Jan 91 00:19:23 GMT References: <442@data.UUCP> <4408:Jan421:44:3391@kramden.acf.nyu.edu> <443@data.UUCP> Organization: IR Lines: 39