Reputation: 13887
If I'm playing in the REPL and I've defined a few different methods for a function:
julia> methods(next)
# 3 methods for generic function "next":
next(i::BigInt) at none:1
next(i::Int64) at none:1
next(i) at none:1
Can I make Julia forget some or all of these?
Upvotes: 2
Views: 605
Reputation: 66234
In short, no.
Julia does not have an analog of MATLAB’s
clear
function; once a name is defined in a Julia session (technically, in moduleMain
), 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 withA = 0
. The memory will be released the next time the garbage collector runs; you can force this to happen withgc()
.
(source)
Upvotes: 5