Skip to content

Commit f42f543

Browse files
committed
Merge pull request #27 from magistere/comm
Comment clarification
2 parents 078abff + a8ff282 commit f42f543

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/symbolic.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function mul_numeric_args(args)
128128
(prod, sym_args)
129129
end
130130

131-
# Handles all lengths for ex.args
131+
# Handles `args` of all lengths
132132
# Removes any 0's in a sum
133133
function simplify(::SymbolParameter{:+}, args)
134134
new_args = map(x -> simplify(x), filter(x -> x != 0, args))
@@ -144,7 +144,7 @@ function simplify(::SymbolParameter{:+}, args)
144144
end
145145
end
146146

147-
# Assumes length(ex.args) == 3
147+
# Assumes length(args) == 3
148148
# Removes any 0's in a subtraction
149149
function simplify(::SymbolParameter{:-}, args)
150150
new_args = map(x -> simplify(x), filter(x -> x != 0, args))
@@ -158,13 +158,13 @@ function simplify(::SymbolParameter{:-}, args)
158158
end
159159
end
160160

161-
# Handles all lengths for ex.args
161+
# Handles `args` of all lengths
162162
# Removes any 1's in a product
163163
function simplify(::SymbolParameter{:*}, args)
164164
new_args = map(x -> simplify(x), filter(x -> x != 1, args))
165165
if length(new_args) == 0
166166
return 1
167-
# Special Case: simplify(:(*x)) == x
167+
# Special Case: simplify(:(*(x))) == x
168168
elseif length(new_args) == 1
169169
return new_args[1]
170170
# Special Case: simplify(:(x * y * z * 0)) == 0
@@ -177,7 +177,7 @@ function simplify(::SymbolParameter{:*}, args)
177177
end
178178
end
179179

180-
# Assumes length(ex.args) == 3
180+
# Assumes length(args) == 3
181181
function simplify(::SymbolParameter{:/}, args)
182182
new_args = map(x -> simplify(x), args)
183183
# Special Case: simplify(:(x / 1)) == x
@@ -191,7 +191,7 @@ function simplify(::SymbolParameter{:/}, args)
191191
end
192192
end
193193

194-
# Assumes length(ex.args) == 3
194+
# Assumes length(args) == 3
195195
function simplify(::SymbolParameter{:^}, args)
196196
new_args = map(x -> simplify(x), args)
197197
# Special Case: simplify(:(x ^ 0)) == 1

0 commit comments

Comments
 (0)