arrays...

David Collier-Brown daveb at geac.UUCP
Fri May 6 23:50:03 AEST 1988


| In article <11325 at mimsy.UUCP>, chris at mimsy.UUCP (Chris Torek) writes:
| (Of course, if you add unnamed aggregates, you should also add
| unnamed functions.)

In article <282 at teletron.UUCP> andrew at teletron.UUCP (Andrew Scott) writes:
| I was struck by Chris' comment, however.  How would unnamed functions be
| implemented?  How would they be used?  The { .. } syntax for aggregate declar-
| ations seems natural enough to use for unnamed aggregates, but how would it
| be done for functions?
| I'm just curious.  I can't think of how I would use this sucker.

 In smalltalk, all over the place. (ie, ifTrue [<unnamed-function>])
 In c, for passing to qsort....

	SYNTAX
             qsort(base, nel, width, compar)
             char *base;
             int (*compar)();

	EXAMPLE
             qsort(base, nel, width, { return zcomp($1,$2) });

	Note the problem with parameters...

--dave
-- 
 David Collier-Brown.                 {mnetor yunexus utgpu}!geac!daveb
 Geac Computers International Inc.,   |  Computer Science loses its
 350 Steelcase Road,Markham, Ontario, |  memory (if not its mind) 
 CANADA, L3R 1B3 (416) 475-0525 x3279 |  every 6 months.



More information about the Comp.lang.c mailing list