Julia的findlast()函数在哪里?

Dar*_*enW 4 arrays julia

使用Julia 0.3.8,我试试这个:

julia> t = [0 0 0 1 1 1 0 0 ]
1x8 Array{Int64,2}:
 0  0  0  1  1  1  0  0

julia> findfirst(t)
4

julia> findlast(t)
ERROR: findlast not defined
Run Code Online (Sandbox Code Playgroud)

根据http://julia.readthedocs.org/en/latest/stdlib/arrays/ findlast()存在,与之相比没什么特别之处findfirst().

那么findlast()未定义的是什么?该怎么做?

Ste*_*ski 6

findlast功能在Julia 0.3中不存在 - 它已经被添加到0.4,但我们的点发布策略只是修复错误,而是findlast一个新功能.我已将它添加到Compat包中,这使您可以在旧版Julia中使用"future"功能.如果您Compat通过执行安装Pkg.add("Compat")然后执行using Compat,您将能够使用findlast(和相关的findprev).