document the standard library beside it, not in the readme
This commit is contained in:
19
Readme.org
19
Readme.org
@@ -176,24 +176,9 @@ same name wins over one of ours.
|
|||||||
~sexc~ looks for them beside itself, so a work tree needs nothing set
|
~sexc~ looks for them beside itself, so a work tree needs nothing set
|
||||||
up; installed, ~$(bindir)/sexc~ finds them under ~$(prefix)/share/sex~.
|
up; installed, ~$(bindir)/sexc~ finds them under ~$(prefix)/share/sex~.
|
||||||
|
|
||||||
There is one so far.
|
Each module is documented in a file of its own beside it:
|
||||||
|
|
||||||
*** threading-macros
|
- [[file:lib/threading-macros.org][threading-macros]] --- ~->~, threading a value through a chain of calls
|
||||||
~->~ passes a value through a chain of forms, each step taking what came
|
|
||||||
before it as its first argument, so the chain reads in the order it
|
|
||||||
happens instead of inside out. Clojure spells it this way and this is
|
|
||||||
the same thing:
|
|
||||||
|
|
||||||
#+begin_src scheme
|
|
||||||
(import threading-macros)
|
|
||||||
|
|
||||||
(-> 5 double-it (add 3) double-it) ; (double-it (add (double-it 5) 3))
|
|
||||||
(-> lp (. a x)) ; lp->a->x
|
|
||||||
(-> q .length-sq) ; a method is a step like any other
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
A step that is not a list is a call of one argument: ~(-> x f)~ is
|
|
||||||
~(f x)~.
|
|
||||||
|
|
||||||
** Read-time feature expressions
|
** Read-time feature expressions
|
||||||
Sex is able to use ~#+~ and ~#-~ for conditional compilation: the form that
|
Sex is able to use ~#+~ and ~#-~ for conditional compilation: the form that
|
||||||
|
|||||||
16
lib/threading-macros.org
Normal file
16
lib/threading-macros.org
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
* threading-macros
|
||||||
|
~->~ passes a value through a chain of forms, each step taking what came
|
||||||
|
before it as its first argument, so the chain reads in the order it
|
||||||
|
happens instead of inside out. Clojure spells it this way and this is
|
||||||
|
the same thing:
|
||||||
|
|
||||||
|
#+begin_src scheme
|
||||||
|
(import threading-macros)
|
||||||
|
|
||||||
|
(-> 5 double-it (add 3) double-it) ; (double-it (add (double-it 5) 3))
|
||||||
|
(-> lp (. a x)) ; lp->a->x
|
||||||
|
(-> q .length-sq) ; a method is a step like any other
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
A step that is not a list is a call of one argument: ~(-> x f)~ is
|
||||||
|
~(f x)~.
|
||||||
Reference in New Issue
Block a user