Module Loading

From Onix OS Wiki
Jump to: navigation, search

It is easy to install modules and define Module contents in this language. File extension “.olm”. Let’s start by examining the programming language example.

hello.olm (as hello module)[edit | edit source]

def hello = fn(name){ 
  show("Hello, "+name+"! Welcome to O Language")
}

load.ola (main file)[edit | edit source]

load "hello.olm"

def name = "Oytun";
println(hello(name));

Run[edit | edit source]

$ olang load.ola

Result[edit | edit source]

Hello, Oytun! Welcome to O Language

In this way, we load the module and call the function in it. The last function called is just a function, so it responds to our call.