From 3b63476588a94068fec9d7d1061690357dac4238 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Sat, 14 Mar 2015 09:33:50 -0400 Subject: [PATCH 1/3] Move anaphoric function intro up into Functions section --- readme-template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme-template.md b/readme-template.md index 5351fe7..b0cabc1 100644 --- a/readme-template.md +++ b/readme-template.md @@ -34,9 +34,7 @@ Include this in your emacs settings to get syntax highlighting: ## Functions -[[ function-list ]] - -## Anaphoric functions +All functions and constructs in the library are prefixed with a dash (-). There are also anaphoric versions of functions where that makes sense, prefixed with two dashes instead of one. @@ -61,6 +59,8 @@ of course the original can also be written like which demonstrates the usefulness of both versions. +[[ function-list ]] + [[ function-docs ]] ## Contribute From 1d4881f5e3bc945be1e0db58fa67a95a14c5da11 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Sat, 14 Mar 2015 10:59:01 -0400 Subject: [PATCH 2/3] Update README --- README.md | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 325850a..a7782b6 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,31 @@ Include this in your emacs settings to get syntax highlighting: ## Functions +All functions and constructs in the library are prefixed with a dash (-). + +There are also anaphoric versions of functions where that makes sense, +prefixed with two dashes instead of one. + +While `-map` takes a function to map over the list, you can also use +the anaphoric form with double dashes - which will then be executed +with `it` exposed as the list item. Here's an example: + +```el +(-map (lambda (n) (* n n)) '(1 2 3 4)) ;; normal version + +(--map (* it it) '(1 2 3 4)) ;; anaphoric version +``` + +of course the original can also be written like + +```el +(defun square (n) (* n n)) + +(-map 'square '(1 2 3 4)) +``` + +which demonstrates the usefulness of both versions. + ### Maps @@ -257,31 +282,6 @@ These combinators require Emacs 24 for its lexical scope. So they are offered in * [-fixfn](#-fixfn-fn-optional-equal-test-halt-test) `(fn &optional equal-test halt-test)` * [-prodfn](#-prodfn-rest-fns) `(&rest fns)` -## Anaphoric functions - -There are also anaphoric versions of functions where that makes sense, -prefixed with two dashes instead of one. - -While `-map` takes a function to map over the list, you can also use -the anaphoric form with double dashes - which will then be executed -with `it` exposed as the list item. Here's an example: - -```el -(-map (lambda (n) (* n n)) '(1 2 3 4)) ;; normal version - -(--map (* it it) '(1 2 3 4)) ;; anaphoric version -``` - -of course the original can also be written like - -```el -(defun square (n) (* n n)) - -(-map 'square '(1 2 3 4)) -``` - -which demonstrates the usefulness of both versions. - ## Maps From a803dd51af74b681c57b07fc5cdb7518bd3d1d5b Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Sat, 14 Mar 2015 10:56:50 -0400 Subject: [PATCH 3/3] Merge readme changes --- dash-template.texi | 6 ++++++ dash.texi | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/dash-template.texi b/dash-template.texi index 58bb139..0e7dfc2 100644 --- a/dash-template.texi +++ b/dash-template.texi @@ -433,6 +433,12 @@ script for generating documentation. @item @uref{https://github.com/holomorph,Mark Oteiza} contributed the script to create an info manual. +@item +@uref{https://github.com/wasamasa,Vasilij Schneidermann} contributed +@code{-some}. +@item +@uref{https://github.com/occidens,William West} made @code{-fixfn} +more robust at handling floats. @end itemize Thanks! diff --git a/dash.texi b/dash.texi index 656acaf..19d0e38 100644 --- a/dash.texi +++ b/dash.texi @@ -3580,6 +3580,12 @@ script for generating documentation. @item @uref{https://github.com/holomorph,Mark Oteiza} contributed the script to create an info manual. +@item +@uref{https://github.com/wasamasa,Vasilij Schneidermann} contributed +@code{-some}. +@item +@uref{https://github.com/occidens,William West} made @code{-fixfn} +more robust at handling floats. @end itemize Thanks!