From a5a47ba1089a99cbb149c8b380a74da7d4e6316a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20Courant?= Date: Mon, 7 Dec 2020 21:46:01 +0100 Subject: [PATCH] Use pair? for condition on pair --- miniml/compiler/compile.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniml/compiler/compile.scm b/miniml/compiler/compile.scm index 93fd8a1..c24c634 100644 --- a/miniml/compiler/compile.scm +++ b/miniml/compiler/compile.scm @@ -469,7 +469,7 @@ (define (get-lident s) (let ((p (assoc s kw))) - (if p (cdr p) (cons 'LIDENT s)))) + (if (pair? p) (cdr p) (cons 'LIDENT s)))) (define (mktoken location tk) (make-lexical-token (car tk) location (cdr tk))) @@ -563,7 +563,7 @@ (define (get-operator name) (let ((p (assoc name operator-kw)) (c (string-ref name 0))) - (cond (p (cdr p)) + (cond ((pair? p) (cdr p)) ((string-index "!~?" c) (cons 'PREFIXOP name)) ((string-index "=<>|&$" c) (cons 'INFIXOP0 name)) ((string-index "@^" c) (cons 'INFIXOP1 name))