From da105e0e817e54d4d9126619029441e4795bdd57 Mon Sep 17 00:00:00 2001 From: Rutger van Beusekom Date: Wed, 14 Nov 2018 19:31:00 +0100 Subject: [PATCH] fix 05-assignment-empty.sh --- gash/environment.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gash/environment.scm b/gash/environment.scm index 9121b50..792dc8e 100644 --- a/gash/environment.scm +++ b/gash/environment.scm @@ -53,11 +53,13 @@ (define %functions '()) -(define (assignment name value) - (and value - (set! %global-variables - (assoc-set! %global-variables name value)) - #t)) +(define* (assignment name #:optional value) + (if value + (set! %global-variables + (assoc-set! %global-variables name value)) + (set! %global-variables + (assoc-set! %global-variables name ""))) + #t) (define* (variable name #:optional (default "")) (cond ((string->number name)