anonymous functions

Karl Heuer karl at haddock.ISC.COM
Tue May 24 08:42:51 AEST 1988


In article <799 at .UUCP> peter at ficc.UUCP (Peter da Silva) writes:
>In article <862 at xyzzy.UUCP>, throopw at xyzzy.UUCP writes:
>>         signal( SIGINT, void (int sig){ interrupted = 1; } );
>Of course if you went with this syntax instead of the typecast syntax, there's
>no good reason to disallow:
>	signal ( SIGINT, void (sig) int sig; { interrupted = 1; } );
>After all, pre-ANSI declarations are still allowed.

But they are obsolescent.  They exist only for backward compatibility, which
is not an issue when you're adding something new like anonymous functions.

I'm not sure how easy it is to parse, anyway; I think I'd be satisfied with my
earlier proposal:
	signal(SIGINT, remote(void (int sig), { interrupted = 1; }));
	ctime(&remote(long, 0));

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list