diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2025-11-05 01:20:07 -0800 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2025-11-06 20:28:00 -0800 |
| commit | d8a969e231135978c4dd1fa67559101f506ad6f3 (patch) | |
| tree | 7a556db33abe541fa3f5902690ca93d782c0ecc7 /test | |
| parent | e86c68dffaffee6ba44d98ba06761245f6d5b670 (diff) | |
recursion works for types with depth limit 5
Diffstat (limited to 'test')
| -rw-r--r-- | test/test.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test.ts b/test/test.ts index 672fb4e..5e884ab 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,4 +1,4 @@ -import { createFn } from "../src"; +import { _Evaluate, createFn } from "../src"; const KS_boolToBin = "fn(b, ?(b, 1, 0))"; @@ -6,5 +6,10 @@ const boolArrToBinaryArr = createFn<[boolean[]]>()( `fn(boolArr, map(boolArr, ${KS_boolToBin}))` ); -const result = boolArrToBinaryArr([true, false, true]); -console.log(result); +const factorial = createFn<[number]>()( + `bind(fac,fn(n,?(eq(n, 1),n,mul(n,call(fac,sub(n,1))))))` +); + +const res = factorial(6); + +// console.log(factorial(2)); |
