summaryrefslogtreecommitdiffhomepage
path: root/julia.html.markdown
diff options
context:
space:
mode:
authorAdam Bard <github@adambard.com>2018-08-22 19:48:46 -0700
committerGitHub <noreply@github.com>2018-08-22 19:48:46 -0700
commit67637e02eb88ae70e309378e27b0ffa8ce734105 (patch)
tree7f5137aa327bd1db61cbcc5e4165dc7390bdd6e5 /julia.html.markdown
parent843ba7019323e6e7411cae9d4c0fa83ce98baf92 (diff)
parentf81e0f451b026e5db34bb7181a7f210734566338 (diff)
Merge branch 'master' into julia1
Diffstat (limited to 'julia.html.markdown')
-rw-r--r--julia.html.markdown7
1 files changed, 4 insertions, 3 deletions
diff --git a/julia.html.markdown b/julia.html.markdown
index 07a051e1..891a0a00 100644
--- a/julia.html.markdown
+++ b/julia.html.markdown
@@ -501,9 +501,10 @@ add_10(3) # => 13
map(add_10, [1,2,3]) # => [11, 12, 13]
filter(x -> x > 5, [3, 4, 5, 6, 7]) # => [6, 7]
-# We can use list comprehensions for nicer maps
-[add_10(i) for i = [1, 2, 3]] # => [11, 12, 13]
-[add_10(i) for i in [1, 2, 3]] # => [11, 12, 13]
+# We can use list comprehensions
+[add_10(i) for i = [1, 2, 3]] # => [11, 12, 13]
+[add_10(i) for i in [1, 2, 3]] # => [11, 12, 13]
+[x for x in [3, 4, 5, 6, 7] if x > 5] # => [6, 7]
####################################################
## 5. Types