diff options
author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-05-16 18:31:28 +0200 |
---|---|---|
committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2025-01-05 17:11:20 +0100 |
commit | 66682b1a6862caeadbd872065425a2d672f640a6 (patch) | |
tree | f010bb2afd58bcddfc56b672b8f1532bfa1b446a /src/eval.lisp | |
parent | ce529296fb83b21950c15eab60b23074ccc79c2e (diff) |
Define types for primitives instead of using lists
Diffstat (limited to 'src/eval.lisp')
-rw-r--r-- | src/eval.lisp | 13 |
1 files changed, 2 insertions, 11 deletions
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)) |