From a8587b645383b5f84c5db702f209b3e709119926 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 1 Apr 2017 07:23:10 +0200 Subject: [PATCH] scm: Fix bug in assq-set! * module/mes/scm.mes (assq-set!): Bugfix. --- module/mes/scm.mes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/mes/scm.mes b/module/mes/scm.mes index a171da4e..04019499 100644 --- a/module/mes/scm.mes +++ b/module/mes/scm.mes @@ -98,9 +98,9 @@ (define (assq-set! alist key val) (let ((entry (assq key alist))) - (cond (entry (set-cdr! entry val) - alist) - (#t (cons (cons key val) alist))))) + (if (not entry) (acons key val alist) + (let ((entry (set-cdr! entry val))) + alist)))) (define (assq-ref alist key) (let ((entry (assq key alist)))