- :dictionary
- :block
- or :nothing
import
import given package
Parameters
import package :string :literal :block
Attributes
| version | :version | specify package version |
| min | get any version >= the specified one | |
| branch | :string, :literal | use specific branch for repository url (default: main) |
| latest | always check for the latest version available | |
| lean | return as a dictionary, instead of importing in main namespace | |
| only | :block | import only selected symbols, if available |
| verbose | output extra information |
Returns
Examples
copyimport "dummy" ; import the package 'dummy' do :: print dummyFunc 10 ; and use it :)
copyimport.version:0.0.3 "dummy" ; import a specific version import.min.version:0.0.3 "dummy" ; import at least the give version; ; if there is a newer one, it will pull this one
copyimport.latest "dummy" ; whether we already have the package or not ; always try to pull the latest version
copyimport "https://github.com/arturo-lang/dummy-package" ; we may also import user repositories directly import.branch:"main" "https://github.com/arturo-lang/dummy-package" ; even specifying the branch to pull
copyimport "somefile.art" ; importing a local file is possible import "somepackage" ; the same works if we have a folder that ; is actually structured like a package
copyd: import.lean "dummy" ; importing a package as a dictionary ; for better namespace isolation do [ print d\dummyFunc 10 ; works fine :) ]