Function composition: Difference between revisions
Content added Content deleted
Line 183: | Line 183: | ||
F sin arc sin = compose(sin, arc sin); |
F sin arc sin = compose(sin, arc sin); |
||
print((sin arc sin(0.5), (sin O arc sin)(0.5), new line))</syntaxhighlight> |
print((sin arc sin(0.5), (sin O arc sin)(0.5), new line))</syntaxhighlight> |
||
=={{header|Amazing Hopper}}== |
|||
VERSION 1: |
|||
<syntaxhighlight lang="c"> |
|||
#defn Compose(_FX_,_FY_) _FX_,_FY_ |
|||
main: |
|||
0.5,Compose(sin,arcsin) |
|||
"\n", print |
|||
{0}return |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
$ hopper3 basica/compose1.hop |
|||
0.500000 |
|||
</pre> |
|||
VERSION 2: |
|||
<syntaxhighlight lang="c"> |
|||
#define-a «(_X_) _X_ ) |
|||
#define Compose(_FX_,_FY_) _FC_(_FX_,_FY_, |
|||
#define _FC_(_X_,_Y_,*) *,_X_,_Y_ |
|||
main: |
|||
Compose(sin,arcsin)«( 0.5) |
|||
"\n", print |
|||
{0}return |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
$ hopper3 basica/compose2.hop |
|||
0.500000 |
|||
</pre> |
|||
=={{header|AntLang}}== |
=={{header|AntLang}}== |