在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Roger-luo/FromFile.jl开源软件地址:https://github.com/Roger-luo/FromFile.jl开源编程语言:Julia 100.0%开源软件介绍:FromFile.jlThis package exports a macro The hope is that you will never have to write InstallationFromFile is a Julia Language package. To install FromFile, please open Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then type the following command
UsageObjects in other files may be imported in the following way: # file1.jl
import FromFile: @from
@from "file2.jl" import foo
bar() = foo()
#file2.jl
foo() = println("hi") File systems may be navigated: The usual import syntax is supported; the only difference is that the objects are looked up in the file requested: Using SpecificationFromFile.jl is a draft implementation of this specification, for improving import systems as discussed in Issue 4600. TipsFromFile will (besides its programmatic benefits like the removal of spooky action at a distance) help you keep track of what objects are defined in what file. When converting over to FromFile that may mean untangling your existing project, and figuring out exactly what you defined where. To print out which file defines which object, you can execute the following bash snippet at the root of your project: for f in $(find . -name '*.jl'); do echo $f && cat $f | vim - -nes -c '%s/#.*//ge' -c '%s/"""\_.\{-}"""//ge' -c '%v/^\S\+/d_' -c '%g/^\(end\|@from\|using\|export\|import\|include\|begin\|let\)\>/d_' -c '%g/.*/exe "norm >>"' -c ':%p' -c ':q!' | tail -n +2; done | less This should (hopefully) print out each file, and the objects defined in that file. It's not perfect, but it'll help you get 90% of the way there. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论