[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 0e5c69b 089/439: Docs: more concise example for an
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 0e5c69b 089/439: Docs: more concise example for anaphoric functions. |
Date: |
Tue, 04 Aug 2015 20:26:44 +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 8c75026 080/439: Add !drop, (continued)
- [elpa] externals/dash 8c75026 080/439: Add !drop, Phillip Lord, 2015/08/04
- [elpa] externals/dash 123eaaa 078/439: Docs: Refer to !replace-where from !!replace-where., Phillip Lord, 2015/08/04
- [elpa] externals/dash ec835e4 081/439: Add !split-at, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3802890 082/439: Simplify !concat, Phillip Lord, 2015/08/04
- [elpa] externals/dash fea1aa3 086/439: Add -interleave, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0dab44c 084/439: Add -flatten, Phillip Lord, 2015/08/04
- [elpa] externals/dash 82a12a2 076/439: Add !drop-while, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9ff9fd0 085/439: Move functions that are not strictly list related last., Phillip Lord, 2015/08/04
- [elpa] externals/dash 38cc9e7 088/439: Simplify -interleave with -none?, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4b5e24b 087/439: Docs: move -any? -all? -none? and -each up., Phillip Lord, 2015/08/04
- [elpa] externals/dash 0e5c69b 089/439: Docs: more concise example for anaphoric functions.,
Phillip Lord <=
- [elpa] externals/dash f8d74ff 091/439: Docs: update example text to match example code., Phillip Lord, 2015/08/04
- [elpa] externals/dash b0da7b2 093/439: Declare macros before using them., Phillip Lord, 2015/08/04
- [elpa] externals/dash 6931d8a 094/439: Remove Melpa from installation while waiting for it to be included., Phillip Lord, 2015/08/04
- [elpa] externals/dash 0c55a4b 090/439: 1.0.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0bd26ac 096/439: Add aliases for -p instead of ?, Phillip Lord, 2015/08/04
- [elpa] externals/dash a2941cd 097/439: Typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash dc6f46c 098/439: Simplify docs-generation using dash., Phillip Lord, 2015/08/04
- [elpa] externals/dash f1c8453 083/439: Rename to dash., Phillip Lord, 2015/08/04
- [elpa] externals/dash eacb6f2 092/439: Docs: Better generation of github urls., Phillip Lord, 2015/08/04
- [elpa] externals/dash 12ed9f6 100/439: Add destructive operations !cons og !cdr, Phillip Lord, 2015/08/04