Function composition: Difference between revisions
Content added Content deleted
m (→{{header|ATS}}) |
|||
Line 377: | Line 377: | ||
That '''compose''' should return ''a new function'', which will exist independently of '''compose''' once created. A person should never have to call '''compose''' merely to get the result of the composed computation. |
That '''compose''' should return ''a new function'', which will exist independently of '''compose''' once created. A person should never have to call '''compose''' merely to get the result of the composed computation. |
||
Thus it is probably impossible, for instance, to ''really'' satisfy the requirement in standard C, if the result of composition is to be called like an ordinary function. However, |
Thus it is probably impossible, for instance, to ''really'' satisfy the requirement in standard C, if the result of composition is to be called like an ordinary function. However, [[#C|the C solution]] shows it is possible, ''if'' the notion of a function is expanded to include structures requiring more than just a plain C function call. Also, there is at least one platform-dependent library for creating a "true" closure in C. |
||
In ATS we have closures, but of more than one kind. |
In ATS we have closures, but of more than one kind. |