gpt4 book ai didi

methods - 我能让 Julia 忘记 REPL 中的方法吗

转载 作者:行者123 更新时间:2023-12-02 04:15:39 27 4
gpt4 key购买 nike

如果我在 REPL 中玩并且我为函数定义了几种不同的方法:

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

我能让 Julia 忘记其中一些或全部吗?

最佳答案

简而言之,不。

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().

( source )

关于methods - 我能让 Julia 忘记 REPL 中的方法吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33927523/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com