julia> conn = connect(1234)
ERROR: UndefVarError: connect not defined
Stacktrace:
[1] top-level scope at REPL[1]:1
Run Code Online (Sandbox Code Playgroud)
更新后它不起作用,所以是否有任何新关键字被替换?
help?> connect
search: continue countlines count_ones
Couldn't find connect
Perhaps you meant convert, collect, const, count or conj
No documentation found.
Binding connect does not exist.
Run Code Online (Sandbox Code Playgroud)
在尝试将预先存在的代码移植到 julia 1.x 时,Julia 0.7 版是一个方便的工具:对于 Julia 1.0.0 中已弃用的所有函数,julia 0.7 中会显示警告。
在以下特定情况下connect:
shell$ julia-0.7.0 _
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _ | |
| | |_| | | | (_| | | Version 0.7.0 (2018-08-08 06:46 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia> connect
WARNING: Base.connect is deprecated: it has been moved to the standard library package `Sockets`.
Add `using Sockets` to your imports.
in module Main
connect (generic function with 8 methods)
Run Code Online (Sandbox Code Playgroud)
按照此消息中给出的信息,connect现在应用作:
using Sockets
socket = connect(1234)
Run Code Online (Sandbox Code Playgroud)