Here is a quote from the documentation (https://docs.julialang.org/en/latest/manual/faq/)
Julia does not have an analog of MATLAB's clear function; once a name is defined in a Julia session (technically, in module Main), it is always present.
If memory usage is your concern, you can always replace objects with ones that consume less memory. For example, if A is a gigabyte-sized array that you no longer need, you can free the memory with A = 0. The memory will be released the next time the garbage collector runs; you can force this to happen with gc().
and see this discussion: https://discourse.julialang.org/t/why-julia-has-no-clear-variable/6541.
The proposed workaround, A = 0, has the problem that if I attempt to use the variable A at a later point, there will be no error, which can be unsafe when my intended behaviour wast to clear the variable to prevent its future use.
A better solution is to use A = nothing (as suggested by aaowens in the linked discusion), because most methods will fail with a Void and throw an error. I think the documentation should suggest A = nothing to "clear" variables instead of A = 0.
And what's the way to do this for functions? I'm getting
julia> f = nothing
ERROR: invalid redefinition of constant f
Stacktrace:
[1] top-level scope at none:0
There isn't one.