reformat some readme stuff
This commit is contained in:
parent
751388b04c
commit
df6b5b5f06
2 changed files with 11 additions and 12 deletions
21
Readme.org
21
Readme.org
|
|
@ -96,9 +96,9 @@ Like the *if form*, if the conditional returns a non-boolean value the *while lo
|
|||
|
||||
#+BEGIN_SRC lisp
|
||||
(while (get-my-flag global-state) ;; if false, returns (nothing) immediately
|
||||
(dothing) ;; this is evaluated
|
||||
"simple token" ;; this is also evaluated
|
||||
(toggle-my-flag global-state)) ;; this is also evaluated
|
||||
(dothing) ;; this is evaluated
|
||||
"simple token" ;; this is also evaluated
|
||||
(toggle-my-flag global-state)) ;; this is also evaluated
|
||||
#+END_SRC
|
||||
|
||||
**** 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:
|
||||
|
||||
#+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)
|
||||
(q a) ;; returns the symbol a
|
||||
(q a) ;; returns the symbol a
|
||||
#+END_SRC
|
||||
(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 plus-one 'adds 1 to a number' (x) (add 1 x)) ;; a function
|
||||
(def multi-func 'example of multi form function'
|
||||
(x y) ;; args
|
||||
(x y) ;; args
|
||||
(inc my-iter) ;; an intermediate calculation
|
||||
(add x y my-iter)) ;; the final form of the function. X+Y+MYITER is returned
|
||||
#+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)))
|
||||
|
||||
;; iterate over each element in mylist
|
||||
(while (gt? (len (cdr myiter)) 0) ;; while there are more elements to consume
|
||||
(let ((elem (car myiter)) ;; elem = consumed element from myiter
|
||||
(remaining (cdr myiter))) ;; remaining = rest of elements
|
||||
(echo elem) ;; do a thing with the element, could be any operation
|
||||
(while (gt? (len (cdr myiter)) 0) ;; while there are more elements to consume
|
||||
(let ((elem (car myiter)) ;; elem = consumed element from myiter
|
||||
(remaining (cdr myiter))) ;; remaining = rest of elements
|
||||
(echo elem) ;; do a thing with the element, could be any operation
|
||||
(def myiter (head remaining)))) ;; consume next element, loop
|
||||
#+END_SRC
|
||||
|
||||
|
|
@ -494,7 +494,6 @@ Note: this section only tracks the state of incomplete TODO items. Having everyt
|
|||
- Readme documentation for POSIX module
|
||||
- logging library
|
||||
- make const all the error messages
|
||||
- Should globals be immutable?
|
||||
|
||||
** TODO alpha tasks
|
||||
- Rename to Flesh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue