From dc872d15aeda2692e69a0ba7411b5fe9322e2727 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Thu, 5 Feb 2026 13:38:26 -0500 Subject: [PATCH] style: no debug commands --- cmd/lambda/lambda.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cmd/lambda/lambda.go b/cmd/lambda/lambda.go index a85cb28..2276c3f 100644 --- a/cmd/lambda/lambda.go +++ b/cmd/lambda/lambda.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "os" "git.maximhutz.com/max/lambda/internal/cli" @@ -18,41 +17,38 @@ func main() { logger.Info("parsed CLI options", "options", options) r := GetRegistry() - fmt.Println(1) + // Get input. input, err := options.Source.Extract() cli.HandleError(err) - fmt.Println(2) // Parse code into syntax tree. repr, err := r.Unmarshal(input, "saccharine") cli.HandleError(err) logger.Info("parsed syntax tree", "tree", repr) - fmt.Println(3) // Compile expression to lambda calculus. compiled, err := r.ConvertTo(repr, "lambda") cli.HandleError(err) logger.Info("compiled λ expression", "tree", compiled) - fmt.Println(4) + // Create reducer with the compiled expression. engine, err := r.GetDefaultEngine("lambda") cli.HandleError(err) - fmt.Println(5) err = engine.Set(compiled) cli.HandleError(err) // Run reduction. for engine.Step(1) { } - fmt.Println(6) + // Return the final reduced result. result, err := engine.Get() cli.HandleError(err) - fmt.Println(7, result) + output, err := r.Marshal(result) cli.HandleError(err) - fmt.Println(8) + err = options.Destination.Write(output) cli.HandleError(err) }