From d8a969e231135978c4dd1fa67559101f506ad6f3 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Wed, 5 Nov 2025 01:20:07 -0800 Subject: recursion works for types with depth limit 5 --- test/test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test') 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)); -- cgit v1.2.3-70-g09d2