From d917f41beca176b8f2b682ac3a2c25b148752b71 Mon Sep 17 00:00:00 2001 From: Thomas Albers Raviola Date: Wed, 15 May 2024 16:21:29 +0200 Subject: Add syntax form for writing macros * src/core.lisp (syntax): Change evaluation rules to replace arguments inside macro expansion. * src/eval.lisp (tree-eval): Add Evaluation route for chains with a syntax closure. * t/test4.chn: New file. --- src/types.lisp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/types.lisp') diff --git a/src/types.lisp b/src/types.lisp index 09ede2b..06183b1 100644 --- a/src/types.lisp +++ b/src/types.lisp @@ -36,15 +36,20 @@ :initarg :specialp :type boolean :documentation "") + (type :reader closure-type + :initarg :type + :type keyword + :documentation "") (groupp :reader closure-group-p :initarg :groupp :type function :documentation ""))) -(defun make-closure (function arg-list specialp groupp &optional environment) +(defun make-closure (function arg-list specialp groupp &optional environment type) (make-instance 'closure :function function :arg-list arg-list :specialp specialp :groupp groupp - :environment environment)) + :environment environment + :type type)) (defun closurep (object) (typep object 'closure)) -- cgit v1.2.3