Release 1.8.0

master
Magnar Sveen 13 years ago
parent 788573e079
commit 824fcb3531
  1. 42
      README.md
  2. 2
      dash.el
  3. 18
      dev/examples.el
  4. 6
      readme-template.md

@ -12,8 +12,6 @@ Or you can just dump `dash.el` in your load path somewhere.
## Functions
* [-first-item](#-first-item-list) `(list)`
* [-last-item](#-last-item-list) `(list)`
* [-map](#-map-fn-list) `(fn list)`
* [-reduce-from](#-reduce-from-fn-initial-value-list) `(fn initial-value list)`
* [-reduce-r-from](#-reduce-r-from-fn-initial-value-list) `(fn initial-value list)`
@ -66,6 +64,8 @@ Or you can just dump `dash.el` in your load path somewhere.
* [-zip](#-zip-list1-list2) `(list1 list2)`
* [-first](#-first-pred-list) `(pred list)`
* [-last](#-last-pred-list) `(pred list)`
* [-first-item](#-first-item-list) `(list)`
* [-last-item](#-last-item-list) `(list)`
* [-union](#-union-list-list2) `(list list2)`
* [-difference](#-difference-list-list2) `(list list2)`
* [-intersection](#-intersection-list-list2) `(list list2)`
@ -113,22 +113,6 @@ which demonstrates the usefulness of both versions.
## Documentation and examples
### -first-item `(list)`
Returns the first item of `list`, or nil on an empty list.
```cl
(-first-item '(1 2 3)) ;; => 1
```
### -last-item `(list)`
Returns the first item of `list`, or nil on an empty list.
```cl
(-last-item '(1 2 3)) ;; => 3
```
### -map `(fn list)`
Returns a new list consisting of the result of applying `fn` to the items in `list`.
@ -711,6 +695,22 @@ Return the last x in `list` where (`pred` x) is non-nil, else nil.
(--last (> (length it) 3) '("a" "looong" "word" "and" "short" "one")) ;; => "short"
```
### -first-item `(list)`
Returns the first item of `list`, or nil on an empty list.
```cl
(-first-item '(1 2 3)) ;; => 1
```
### -last-item `(list)`
Returns the first item of `list`, or nil on an empty list.
```cl
(-last-item '(1 2 3)) ;; => 3
```
### -union `(list list2)`
Return a new list containing the elements of `list1` and elements of `list2` that are not in `list1`.
@ -964,6 +964,10 @@ Change `readme-template.md` or `examples-to-docs.el` instead.
## Changelist
### From 1.7.0 to master
- Add `-first-item` and `-last-item` (Wilfred Hughes)
### From 1.6.0 to 1.7.0
- Add `-rotate` (Matus Goljer)
@ -1002,7 +1006,7 @@ Change `readme-template.md` or `examples-to-docs.el` instead.
- [tali713](https://github.com/tali713) is the author of `-applify`.
- [Víctor M. Valenzuela](https://github.com/vemv) contributed `-repeat`.
- [Nic Ferrier](https://github.com/nicferrier) contributed `-cons*`.
- [Wilfred Hughes](https://github.com/Wilfred) contributed `-slice`.
- [Wilfred Hughes](https://github.com/Wilfred) contributed `-slice`, `-first-item` and `-last-item`.
- [Emanuel Evans](https://github.com/shosti) contributed `-if-let`, `-when-let` and `-insert-at`.
- [Johan Andersson](https://github.com/rejeep) contributed `-sum`, `-product`, `-min`, `-max`, `-min-by` and `-max-by`.

@ -3,7 +3,7 @@
;; Copyright (C) 2012 Magnar Sveen
;; Author: Magnar Sveen <magnars@gmail.com>
;; Version: 1.7.0
;; Version: 1.8.0
;; Keywords: lists
;; This program is free software; you can redistribute it and/or modify

@ -9,14 +9,6 @@
(defun square (num) (* num num))
(defun three-letters () '("A" "B" "C"))
(defexamples -first-item
(-first-item '(1 2 3)) => 1
(-first-item nil => nil))
(defexamples -last-item
(-last-item '(1 2 3)) => 3
(-last-item nil => nil))
(defexamples -map
(-map (lambda (num) (* num num)) '(1 2 3 4)) => '(1 4 9 16)
(-map 'square '(1 2 3 4)) => '(1 4 9 16)
@ -209,7 +201,7 @@
(defexamples -rotate
(-rotate 3 '(1 2 3 4 5 6 7)) => '(5 6 7 1 2 3 4)
(-rotate -3 '(1 2 3 4 5 6 7)) => '(4 5 6 7 1 2 3))
(-rotate -3 '(1 2 3 4 5 6 7)) => '(4 5 6 7 1 2 3))
(defexamples -insert-at
(-insert-at 1 'x '(a b c)) => '(a x b c)
@ -293,6 +285,14 @@
(-last 'even? '(1 3 7 5 9)) => nil
(--last (> (length it) 3) '("a" "looong" "word" "and" "short" "one")) => "short")
(defexamples -first-item
(-first-item '(1 2 3)) => 1
(-first-item nil => nil))
(defexamples -last-item
(-last-item '(1 2 3)) => 3
(-last-item nil => nil))
(defexamples -union
(-union '(1 2 3) '(3 4 5)) => '(1 2 3 4 5)
(-union '(1 2 3 4) '()) => '(1 2 3 4)

@ -71,6 +71,10 @@ Change `readme-template.md` or `examples-to-docs.el` instead.
## Changelist
### From 1.7.0 to 1.8.0
- Add `-first-item` and `-last-item` (Wilfred Hughes)
### From 1.6.0 to 1.7.0
- Add `-rotate` (Matus Goljer)
@ -109,7 +113,7 @@ Change `readme-template.md` or `examples-to-docs.el` instead.
- [tali713](https://github.com/tali713) is the author of `-applify`.
- [Víctor M. Valenzuela](https://github.com/vemv) contributed `-repeat`.
- [Nic Ferrier](https://github.com/nicferrier) contributed `-cons*`.
- [Wilfred Hughes](https://github.com/Wilfred) contributed `-slice`.
- [Wilfred Hughes](https://github.com/Wilfred) contributed `-slice`, `-first-item` and `-last-item`.
- [Emanuel Evans](https://github.com/shosti) contributed `-if-let`, `-when-let` and `-insert-at`.
- [Johan Andersson](https://github.com/rejeep) contributed `-sum`, `-product`, `-min`, `-max`, `-min-by` and `-max-by`.

Loading…
Cancel
Save