aboutsummaryrefslogtreecommitdiff
path: root/src/eval.lisp
diff options
context:
space:
mode:
authorThomas Albers Raviola <thomas@thomaslabs.org>2024-05-16 18:31:28 +0200
committerThomas Albers Raviola <thomas@thomaslabs.org>2024-05-16 18:31:28 +0200
commitf19998f7fd9db2bd1ed4eb80ea1744a013b166fa (patch)
treef010bb2afd58bcddfc56b672b8f1532bfa1b446a /src/eval.lisp
parentd917f41beca176b8f2b682ac3a2c25b148752b71 (diff)
Define types for primitives instead of using lists
* src/parser.lisp: Add alias for shorting chain calls. First symbol may be outside chain. * src/types.lisp: Remove specialp from closure class
Diffstat (limited to 'src/eval.lisp')
-rw-r--r--src/eval.lisp13
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))