mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-23 14:17:02 +03:00
commit
51db840c79
@ -172,11 +172,11 @@ undefined ; user to indicate a value that hasn't been set
|
|||||||
; Comprehensions
|
; Comprehensions
|
||||||
|
|
||||||
; `range` or `..` generates a list of numbers for
|
; `range` or `..` generates a list of numbers for
|
||||||
; each number between it's two args.
|
; each number between its two args.
|
||||||
(range 1 5) ; => (1 2 3 4 5)
|
(range 1 5) ; => (1 2 3 4 5)
|
||||||
(.. 0 2) ; => (0 1 2)
|
(.. 0 2) ; => (0 1 2)
|
||||||
|
|
||||||
; `map` applies it's first arg(which should be a lambda/function)
|
; `map` applies its first arg (which should be a lambda/function)
|
||||||
; to each item in the following arg (which should be a list)
|
; to each item in the following arg (which should be a list)
|
||||||
(map (-> (x) (+ x 1)) (1 2 3)) ; => (2 3 4)
|
(map (-> (x) (+ x 1)) (1 2 3)) ; => (2 3 4)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user