reformat some readme stuff

This commit is contained in:
Ava Apples Affine 2023-03-20 23:11:29 -07:00
parent 751388b04c
commit df6b5b5f06
Signed by: affine
GPG key ID: 3A4645B8CF806069
2 changed files with 11 additions and 12 deletions

View file

@ -96,9 +96,9 @@ Like the *if form*, if the conditional returns a non-boolean value the *while lo
#+BEGIN_SRC lisp #+BEGIN_SRC lisp
(while (get-my-flag global-state) ;; if false, returns (nothing) immediately (while (get-my-flag global-state) ;; if false, returns (nothing) immediately
(dothing) ;; this is evaluated (dothing) ;; this is evaluated
"simple token" ;; this is also evaluated "simple token" ;; this is also evaluated
(toggle-my-flag global-state)) ;; this is also evaluated (toggle-my-flag global-state)) ;; this is also evaluated
#+END_SRC #+END_SRC
**** Let **** Let
@ -172,9 +172,9 @@ The *quote* function allows data (code) to be passed around without evaluating i
To be specific, typing ~(a)~ usually results in a symbol lookup for ~a~, and then possibly even a function call. However, if we *quote* ~a~, we can pass around the symbol itself: To be specific, typing ~(a)~ usually results in a symbol lookup for ~a~, and then possibly even a function call. However, if we *quote* ~a~, we can pass around the symbol itself:
#+BEGIN_SRC lisp #+BEGIN_SRC lisp
(quote a) ;; returns the symbol a (quote a) ;; returns the symbol a
(quote (add 1 2)) ;; returns the following tree: (add 1 2) (quote (add 1 2)) ;; returns the following tree: (add 1 2)
(q a) ;; returns the symbol a (q a) ;; returns the symbol a
#+END_SRC #+END_SRC
(note that ~quote~ may be shortened to ~q~) (note that ~quote~ may be shortened to ~q~)
@ -243,7 +243,7 @@ In this case, the value derived from the final form in the function will be retu
(def my-iter 'an iterator to use in my while loop' 0) ;; a variable (def my-iter 'an iterator to use in my while loop' 0) ;; a variable
(def plus-one 'adds 1 to a number' (x) (add 1 x)) ;; a function (def plus-one 'adds 1 to a number' (x) (add 1 x)) ;; a function
(def multi-func 'example of multi form function' (def multi-func 'example of multi form function'
(x y) ;; args (x y) ;; args
(inc my-iter) ;; an intermediate calculation (inc my-iter) ;; an intermediate calculation
(add x y my-iter)) ;; the final form of the function. X+Y+MYITER is returned (add x y my-iter)) ;; the final form of the function. X+Y+MYITER is returned
#+END_SRC #+END_SRC
@ -333,10 +333,10 @@ The author encourages any users to contribute their own personal favorites not a
(def myiter 'iterator over a list' (head (1 2 3 4 5 6))) (def myiter 'iterator over a list' (head (1 2 3 4 5 6)))
;; iterate over each element in mylist ;; iterate over each element in mylist
(while (gt? (len (cdr myiter)) 0) ;; while there are more elements to consume (while (gt? (len (cdr myiter)) 0) ;; while there are more elements to consume
(let ((elem (car myiter)) ;; elem = consumed element from myiter (let ((elem (car myiter)) ;; elem = consumed element from myiter
(remaining (cdr myiter))) ;; remaining = rest of elements (remaining (cdr myiter))) ;; remaining = rest of elements
(echo elem) ;; do a thing with the element, could be any operation (echo elem) ;; do a thing with the element, could be any operation
(def myiter (head remaining)))) ;; consume next element, loop (def myiter (head remaining)))) ;; consume next element, loop
#+END_SRC #+END_SRC
@ -494,7 +494,6 @@ Note: this section only tracks the state of incomplete TODO items. Having everyt
- Readme documentation for POSIX module - Readme documentation for POSIX module
- logging library - logging library
- make const all the error messages - make const all the error messages
- Should globals be immutable?
** TODO alpha tasks ** TODO alpha tasks
- Rename to Flesh - Rename to Flesh

View file

@ -38,7 +38,7 @@ impl Prompt for CustomPrompt<'_> {
fn render_prompt_right(&self) -> Cow<str> { fn render_prompt_right(&self) -> Cow<str> {
{ {
Cow::Owned(format!(" <")) Cow::Owned(format!(""))
} }
} }