Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,2 @@
cd ~/code/modules
mkdir mymodule

View file

@ -0,0 +1,6 @@
module mymodule
// To export a function we have to use 'pub'
pub fn say_hi() {
println('hello from mymodule!')
}

View file

@ -0,0 +1,6 @@
module mymodule
pub fn say_hi_and_bye() {
say_hi() // from myfile.v
println('goodbye from mymodule')
}

View file

@ -0,0 +1,6 @@
import mymodule // name of module in those files
fn main() {
mymodule.say_hi() // function from file 1 (myfile.v)
mymodule.say_hi_and_bye() // function from file 2 (myfile2.v)
}