You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SnaveSutit edited this page Nov 24, 2020
·
11 revisions
Contexts
Folder context refers to where functions and directories can be defined.
Function context refers to syntax inside of functions where commands can be written.
Macro context refers to the folder context inside of .mcm files
#!foo.mc
# Folder context
dir {
# Folder context
function bar {
# Function context
say Hello
}
}
# Folder context
function bas {
# Function context
say World!
}
Functions
You can create functions using the function keyword:
function foo {
say I am called via `function mc_file_name:foo`
}
You can create sub directories using the dir keyword:
dir foo {
function bar {
say I am called via `function mc_file_name:foo/bar`
}
dir bar {
function bas {
say I am called via `function mc_file_name:foo/bar/bas`
}
}
}