From 66682b1a6862caeadbd872065425a2d672f640a6 Mon Sep 17 00:00:00 2001 From: Thomas Albers Raviola Date: Thu, 16 May 2024 18:31:28 +0200 Subject: Define types for primitives instead of using lists --- src/eval.lisp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/eval.lisp') diff --git a/src/eval.lisp b/src/eval.lisp index eede4ad..e3e6617 100644 --- a/src/eval.lisp +++ b/src/eval.lisp @@ -1,19 +1,10 @@ (in-package #:chains) -(defun chainp (object) - (and (consp object) (eq (first object) 'chain))) - -(defun chain-links (chain) - (rest chain)) - -(defun object-symbolp (object) - (and (consp object) (eq (first object) 'symbol))) - (defun tree-eval (environment node) (cond ((null node) nil) - ((object-symbolp node) - (get-var environment (cdr node))) + ((object-symbol-p node) + (get-var environment (object-value node))) ((not (consp node)) node) ((chainp (first node)) -- cgit v1.2.3