summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKeith Miyake <keith.miyake@gmail.com>2018-10-04 15:55:35 -0700
committerKeith Miyake <keith.miyake@gmail.com>2018-10-04 15:55:35 -0700
commit7bd6f99b6b85ee9977be9f1212a8799876e5743c (patch)
tree467a2aeb4563263950b2cb7f2e2d5b6aeac51f3a
parent3499b8358988307eb97481427e345c8fa94e57fc (diff)
[julia/en] snake_case one more function name that slipped past
-rw-r--r--julia.html.markdown10
1 files changed, 5 insertions, 5 deletions
diff --git a/julia.html.markdown b/julia.html.markdown
index 7914f154..0bb629d3 100644
--- a/julia.html.markdown
+++ b/julia.html.markdown
@@ -527,18 +527,18 @@ function create_adder(x)
end
# => create_adder (generic function with 1 method)
-add10 = create_adder(10) # => (::getfield(Main, Symbol("#adder#11")){Int64})
+add_10 = create_adder(10) # => (::getfield(Main, Symbol("#adder#11")){Int64})
# (generic function with 1 method)
-add10(3) # => 13
+add_10(3) # => 13
# There are built-in higher order functions
-map(add10, [1,2,3]) # => [11, 12, 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
-[add10(i) for i = [1, 2, 3]] # => [11, 12, 13]
-[add10(i) for i in [1, 2, 3]] # => [11, 12, 13]
+[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]
####################################################