add docs for circuit

This commit is contained in:
Ava Apples Affine 2023-03-13 21:48:33 -07:00
parent 8efa1dbaad
commit 5bdf409a1f
Signed by: affine
GPG key ID: 3A4645B8CF806069

View file

@ -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