emacs-elpa-diffs
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]