import

import given package


Parameters

import package :string :literal :block

Attributes

version:versionspecify package version
minget any version >= the specified one
branch:string, :literaluse specific branch for repository url (default: main)
latestalways check for the latest version available
leanreturn as a dictionary, instead of importing in main namespace
only:blockimport only selected symbols, if available
verboseoutput extra information

Returns

  • :dictionary
  • :block
  • or  :nothing

Examples

copy
import "dummy" ; import the package 'dummy' do :: print dummyFunc 10 ; and use it :)

copy
import.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

copy
import.latest "dummy" ; whether we already have the package or not ; always try to pull the latest version

copy
import "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

copy
import "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

copy
d: import.lean "dummy" ; importing a package as a dictionary ; for better namespace isolation do [ print d\dummyFunc 10 ; works fine :) ]

Related