Packages will work by returning a value that can be used when you import a package. For example, ``` import "x" ``` Will create a local variable `x` containing the value returned by package "x". You can change the name of the imported package using the syntax below: ``` y = import "x" ``` The value returned from the package could be anything. See examples below: Ex.: ``` # package strings # returns a map of functions fn join(lst, sep) {} fn trimleft(str) {} fn trimright(str) {} fn trim() {} return { "join": $join, "trimleft": $trimleft, "trimright": $trimright, "trim": $trim, } ``` You can use the package above with code below: ```nash import "strings" str <= strings["trim"](" test ") echo $str # Output: test ```
Activity
[-]Packages[/-][+]language: packages with proper namespacing[/+]vitorarins commentedon Apr 15, 2017
I think this depends on #202