Skip to content

Functions & Modules

EasyLang supports custom functions and importing both EasyLang and Python modules.


Defining a Function

define add(a, b): do [
    return a plus b
]

so print add(10, 20)

Using an EasyLang Module

Assume you have math.elangh:

define square(n): do [
    return n mul n
]

Use it:

bring "math.elangh" as math
so print math.square(5)

Using a Python Module

bring math as m
so print m.sqrt(25)

Summary

  • define creates functions
  • return sends back a value
  • bring module as alias loads EasyLang/Python modules