Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,14 @@
REBOL [
Title: "Functional Composition"
URL: http://rosettacode.org/wiki/Functional_Composition
]
; "compose" means something else in REBOL, therefore I use a 'compose-functions name.
compose-functions: func [
{compose the given functions F and G}
f [any-function!]
g [any-function!]
] [
func [x] compose [(:f) (:g) x]
]

View file

@ -0,0 +1,8 @@
foo: func [x] [reform ["foo:" x]]
bar: func [x] [reform ["bar:" x]]
foo-bar: compose-functions :foo :bar
print ["Composition of foo and bar:" mold foo-bar "test"]
sin-asin: compose-functions :sine :arcsine
print [crlf "Composition of sine and arcsine:" sin-asin 0.5]