tisp

tiny lisp
git clone git://edryd.org/tisp
Log | Files | Refs | LICENSE

commit f5f83015e4af8f3def601e7f077b94cea3d77364
parent f32f47079eb2759ab3179a23d63561fb93412468
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Thu, 19 Mar 2020 01:48:42 -0700

Add doc function to print doc string of procedure

Diffstat:
tibs/lib.tsp | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/tibs/lib.tsp b/tibs/lib.tsp @@ -77,6 +77,12 @@ ,(list* 'define name val) (error 'var "incorrect form"))) +(define (doc proc) + "get documentation of function" + (if (string? (car (get proc 'body))) + (disp (car (get proc 'body))) + (error 'doc "procedure not documented"))) + (defmacro (assert expr) `(unless ,expr (error 'assert "assertion " ',expr " failed")))