From 5bdf409a1fcb898100e683d92c2a047856527d57 Mon Sep 17 00:00:00 2001 From: Ava Hahn Date: Mon, 13 Mar 2023 21:48:33 -0700 Subject: [PATCH] add docs for circuit --- Readme.org | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Readme.org b/Readme.org index 0cfb745..9ea66b0 100644 --- a/Readme.org +++ b/Readme.org @@ -122,7 +122,21 @@ Here you can see the usefulness of being able to declare multiple variables in q Each variable is in scope for the duration of the let statement and then dropped when the statement has concluded. Thus, it is little cost to break complex calculations down into reusable parts. -**** TODO Circuit +**** Circuit +*Circuit* is useful to run a sequence of commands in order. +A call to *circuit* comprises of one or more forms in a sequence. +All forms in the call to *circuit* are expected to evaluate to a boolean. +The first form to evaluate to ~false~ halts the sequence, and false is returned. +If all forms evaluate to ~true~, ~true~ is returned. + +Example: +#+BEGIN_SRC lisp + (circuit + (eq? (exit-code my-shell-command) 0) + (get-state-flag global-state) + (eq? (some-big-calculation) result)) +#+END_SRC + **** Not quite control flow Several other functions use lazy evaluation of their arguments. The below list is non-exhaustive: - toggle @@ -350,10 +364,6 @@ Note: this section will not show the status of each item unless you are viewing Note: this section only tracks the state of incomplete TODO items. Having everything on here would be cluttered. *** TODO list contains via circuit -*** TODO Map function -- DOCUMENTATION + TEST: - apply a lambda to a list -*** TODO Reduce function *** TODO Input function *** TODO Lex function *** TODO Read function (Input + Lex) @@ -383,10 +393,13 @@ Overload Load function to call a binary too *** TODO Post to relevant channels *** TODO Custom ast pretty print *** TODO Implement Compose for lambdas +*** TODO Map function +- DOCUMENTATION + TEST: + apply a lambda to a list +*** TODO Reduce function *** TODO file operations **** TODO read-to-string **** TODO write-to-file -*** TODO Pick through core/ast and make sure no unnessesary moves are happening *** TODO Network library **** TODO HTTP Client **** TODO TCP Stream client