[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 0e5c69b 089/426: Docs: more concise example for an
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 0e5c69b 089/426: Docs: more concise example for anaphoric functions. |
Date: |
Tue, 04 Aug 2015 19:36:54 +0000 |
branch: externals/dash
commit 0e5c69b4425c639604a21f39fbd6d2879a82f3aa
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>
Docs: more concise example for anaphoric functions.
---
README.md | 8 ++++----
readme-template.md | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 0218e37..00e6d5e 100644
--- a/README.md
+++ b/README.md
@@ -55,17 +55,17 @@ anaphoric form with double dashes - which will then be
executed with `it` expose
as the list item. Here's an example:
```cl
-(-filter (lambda (num) (= 0 (% num 2))) '(1 2 3 4)) ;; normal version
+(-map (lambda (n) (* n n)) '(1 2 3 4)) ;; normal version
-(--filter (= 0 (% it 2)) '(1 2 3 4)) ;; anaphoric version
+(--map (* it it) '(1 2 3 4)) ;; anaphoric version
```
of course the original can also be written like
```cl
-(defun even? (num) (= 0 (% num 2)))
+(defun square (n) (* n n))
-(-filter 'even? '(1 2 3 4))
+(-map 'square '(1 2 3 4))
```
which demonstrates the usefulness of both versions.
diff --git a/readme-template.md b/readme-template.md
index 706c212..c6aa12e 100644
--- a/readme-template.md
+++ b/readme-template.md
@@ -24,17 +24,17 @@ anaphoric form with double dashes - which will then be
executed with `it` expose
as the list item. Here's an example:
```cl
-(-filter (lambda (num) (= 0 (% num 2))) '(1 2 3 4)) ;; normal version
+(-map (lambda (n) (* n n)) '(1 2 3 4)) ;; normal version
-(--filter (= 0 (% it 2)) '(1 2 3 4)) ;; anaphoric version
+(--map (* it it) '(1 2 3 4)) ;; anaphoric version
```
of course the original can also be written like
```cl
-(defun even? (num) (= 0 (% num 2)))
+(defun square (n) (* n n))
-(-filter 'even? '(1 2 3 4))
+(-map 'square '(1 2 3 4))
```
which demonstrates the usefulness of both versions.
- [elpa] externals/dash 0bd26ac 096/426: Add aliases for -p instead of ?, (continued)
- [elpa] externals/dash 0bd26ac 096/426: Add aliases for -p instead of ?, Phillip Lord, 2015/08/04
- [elpa] externals/dash 38eed45 095/426: Add rainbow-dash, Phillip Lord, 2015/08/04
- [elpa] externals/dash dc6f46c 098/426: Simplify docs-generation using dash., Phillip Lord, 2015/08/04
- [elpa] externals/dash b0da7b2 093/426: Declare macros before using them., Phillip Lord, 2015/08/04
- [elpa] externals/dash 4fedd2e 099/426: Add -partition and -partition-all, Phillip Lord, 2015/08/04
- [elpa] externals/dash 79b56cc 101/426: Use --each, !cons and !cdr to simplify implementations., Phillip Lord, 2015/08/04
- [elpa] externals/dash a08fc14 102/426: Add -each-while, Phillip Lord, 2015/08/04
- [elpa] externals/dash 49512b9 107/426: Simplify -take and -drop with --dotimes, Phillip Lord, 2015/08/04
- [elpa] externals/dash ed47814 105/426: Add -dotimes, Phillip Lord, 2015/08/04
- [elpa] externals/dash eb50d17 106/426: Add Melpa back in., Phillip Lord, 2015/08/04
- [elpa] externals/dash 0e5c69b 089/426: Docs: more concise example for anaphoric functions.,
Phillip Lord <=
- [elpa] externals/dash 03370ea 108/426: Simplify examples-to-docs and examples-to-tests with dash, Phillip Lord, 2015/08/04
- [elpa] externals/dash ba80875 109/426: Nice indentation for --each, --each-while and --dotimes, Phillip Lord, 2015/08/04
- [elpa] externals/dash f1c8453 083/426: Rename to dash., Phillip Lord, 2015/08/04
- [elpa] externals/dash 51ddc13 110/426: Nice indentation for threading macros., Phillip Lord, 2015/08/04
- [elpa] externals/dash ba60707 103/426: Use --each-while to simplify implementations., Phillip Lord, 2015/08/04
- [elpa] externals/dash c56925a 111/426: Add font-lock for new functions and the `it` token., Phillip Lord, 2015/08/04
- [elpa] externals/dash a081c72 114/426: Fix tests., Phillip Lord, 2015/08/04
- [elpa] externals/dash a336d78 112/426: Add -only-some?, Phillip Lord, 2015/08/04
- [elpa] externals/dash 81a3247 104/426: Let -each and -each-while take multiple forms., Phillip Lord, 2015/08/04
- [elpa] externals/dash d857f73 118/426: Merge pull request #3 from rejeep/join-alias, Phillip Lord, 2015/08/04