on master help sign in
Merge pull request #594 from jfranklin9000/stdlib

add ++snoc docs to section 2b

commit6487c2101648438517a48731fc887eb9e798b770 authorrmariani <robert@tlon.io> dateFri 2 Aug 2019, 10:42 (7 years ago) parent10a1282c89c84f
2 files changed+50−1
reference/library/2b.md+48−1 reference/library/_index.md+2
reference/library/2b.md+48−1
@@ -786,6 +786,8 @@ Accepts an atom `a` and list `b`, producing the remaining elements from
786786
787787#### Accepts
788788
789+`a` is an atom.
790+
789791`b` is a list.
790792
791793#### Produces
@@ -824,6 +826,8 @@ of `a`and failing if the list is null. Lists are 0-indexed.
824826
825827#### Accepts
826828
829+`a` is an atom.
830+
827831`b` is a list.
828832
829833#### Produces
@@ -853,6 +857,41 @@ Produces an element of `b`, or crashes if no element exists at that index.
853857```
854858
855859
860+---
861+### `++snoc`
862+
863+Append
864+
865+Accepts a `++list` `a` and a noun `b`, producing the list of `b` appended to `a`.
866+
867+#### Accepts
868+
869+`a` is a list.
870+
871+`b` is a noun.
872+
873+#### Produces
874+
875+Produces a list of `b` appended to `a`.
876+
877+#### Source
878+
879+```
880+ ++ snoc
881+ |* [a/(list) b/*]
882+ (weld a ^+(a [b]~))
883+```
884+
885+#### Examples
886+
887+```
888+ > `tape`(zing (snoc `(list tape)`~["a" "bc" "def"] "g"))
889+ "abcdefg"
890+ > (snoc `(list @ud)`~[1 2 3] 4)
891+ ~[1 2 3 4]
892+```
893+
894+
856895---
857896### `++sort`
858897
@@ -864,6 +903,8 @@ sorted according to `b`.
864903
865904#### Accepts
866905
906+`a` is a list.
907+
867908`b` is a gate that accepts two nouns and produces a boolean.
868909
869910#### Produces
@@ -1015,6 +1056,10 @@ inclusive index `a`, producing `b` number of characters.
10151056
10161057#### Accepts
10171058
1059+`a` is an atom.
1060+
1061+`b` is an atom.
1062+
10181063`c` is a list.
10191064
10201065#### Produces
@@ -1025,7 +1070,7 @@ A list of the same type as `c`.
10251070
10261071```
10271072 ++ swag
1028− |* [[a=@ a=@] c=(list)]
1073+ |* [[a=@ b=@] c=(list)]
10291074 (scag +<-> (slag +<-< c))
10301075```
10311076
@@ -1050,6 +1095,8 @@ to each element of the original list.
10501095
10511096#### Accepts
10521097
1098+`a` is a list.
1099+
10531100`b` is a gate.
10541101
10551102#### Produces
reference/library/_index.md+2
@@ -613,6 +613,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
613613[`++smyt`](@/docs/reference/library/4m.md#smyt)
614614[`++snag`](@/docs/reference/library/2b.md#snag)
615615[`++snag:nl`](@/docs/reference/library/2m.md#snag-nl)
616+[`++snoc`](@/docs/reference/library/2b.md#snoc)
616617[`++so`](@/docs/reference/library/4l.md#so)
617618[`++soft`](@/docs/reference/library/2n.md#soft)
618619[`++some`](@/docs/reference/library/2a.md#some)
@@ -881,6 +882,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
881882[`++skip`](@/docs/reference/library/2b.md#skip)
882883[`++slag`](@/docs/reference/library/2b.md#slag)
883884[`++snag`](@/docs/reference/library/2b.md#snag)
885+[`++snoc`](@/docs/reference/library/2b.md#snoc)
884886[`++sort`](@/docs/reference/library/2b.md#sort)
885887[`++spin`](@/docs/reference/library/2b.md#spin)
886888[`++spun`](@/docs/reference/library/2b.md#spun)