From da1426ed8df6bb41b237ef6bee83801ef29bd545 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Tue, 9 Apr 2024 12:30:50 -0700 Subject: [PATCH] acc is never assigned to... D'oh! --- implementations/scheme-chicken/joy.scm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/implementations/scheme-chicken/joy.scm b/implementations/scheme-chicken/joy.scm index 0ba4241..c4b018a 100644 --- a/implementations/scheme-chicken/joy.scm +++ b/implementations/scheme-chicken/joy.scm @@ -196,13 +196,11 @@ (define (tokenize str) ; Let's do the simple trick. (string-split (string-replace (string-replace str "]" " ] ") "[" " [ "))) -(define (parse tokens) (parse0 tokens '())) - -(define (parse0 tokens acc) - (if (null? tokens) acc +(define (parse tokens) + (if (null? tokens) '() (receive (term rest_of_tokens) (one-token-lookahead (car tokens) (cdr tokens)) - (cons term (parse0 rest_of_tokens acc))))) + (cons term (parse rest_of_tokens))))) (define (one-token-lookahead token tokens) (match token