🐐 First order functions

This commit is contained in:
2026-04-21 18:12:15 +02:00
parent db5b7bf144
commit 693054491f
18 changed files with 407 additions and 46 deletions

11
snippets/invoca_expr.cent Normal file
View File

@@ -0,0 +1,11 @@
// Immediately invoked
DICE(INVOCA FVNCTIO (x) VT { REDI (x + I) } (V))
// From an array
DESIGNA fns VT [FVNCTIO (x) VT { REDI (x + I) }]
DICE(INVOCA fns[I] (V))
// Passing a named function as an argument
DEFINI apply (f, x) VT { REDI (INVOCA f (x)) }
DEFINI sqr (x) VT { REDI (x * x) }
DICE(INVOCA apply (sqr, IV))