Sujet : Re: technology discussion → does the world need a "new" C ?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 11. Jul 2024, 11:02:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240711030106.779@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-07-11, Michael S <
already5chosen@yahoo.com> wrote:
With a C-like typedef, we can declutter the definition of mutiplier:
typedef int (*int_int_fn)(int);
int_int_fn multiplier(int coefficient) {
return lambda(int x) int {
return coefficient * x;
}
}
>
Thank you.
Your example confirms my suspicion that the difference between first
and second class of functions doesn't become material until language
supports closures.
It sort of becomes half-material when the language supports
downward-funarg-only closures, like Pascal and GNU C,
where our lambda is good as long as multiplier doesn't exit.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca