Built-in functions
Julia provides a number of built-in functions, which are very helpful once you fully understand the richness of the Julia base
library. Like every other language, Julia has functions for most common tasks performed by users, as well as some surprises as we go through this topic.
We will now walk through some of the most common built-in functions one by one, along with detailed examples:
workspace()
: This is a function specifically for Julia REPL and isn't available outside of it. The work of this function is actually to clear out the current workspace in the Julia REPL, deleting all the functions, variables, constants, or types defined by the user without needing to exit the REPL and restart it once again.
typeof()
: This function is used mainly to know the data type of an argument passed to it. This is similar to thetype()
function for those familiar with Python:
julia> typeof("Julia") String julia> typeof(1.0) Float64 julia> typeof(1) Int64 julia> typeof(0x23...