Improved closure context persistence. Now it is possibile to define counters like this func(base){func(){@base=base+1}}

This commit is contained in:
2024-06-24 07:20:17 +02:00
parent 3b641ac793
commit e41ddc664c
5 changed files with 82 additions and 63 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ func dummy(ctx ExprContext, name string, args []any) (result any, err error) {
func TestFunctionToStringSimple(t *testing.T) {
source := NewGolangFunctor(dummy)
want := "func() {}"
want := "func(){}"
got := source.ToString(0)
if got != want {
t.Errorf(`(func() -> result = %v [%T], want = %v [%T]`, got, got, want, want)