Piping Arithmetic Operation with Kernel

Ever had a function return a value you want to double or add to? You might be tempted to assign the function value to a variable, do arithmetic and assign the return values of those to more variables. Maybe something like this:

a = foo()
b = a * 2
c = b + 5

But you don’t have to do it this way. In this video we’ll show you how to pipe arithmetic operations, which all sit in the Kernel namespace. We’ll be able to do the following instead:

c = foo() |> Kernel.*(2) |> Kernel.+(5)

Sign up for our newsletter

Get notified of any new episodes as we release them.

© 2020 QuantLayer, LLC. All rights reserved.