Output Functions
Functions for printing to stdout. All output functions accept any number of arguments, which are converted to strings and joined with spaces.
print(…args) -> null
Prints arguments to stdout without a trailing newline.
print("loading")
print("...")
print("\n")
// loading...
println(…args) -> null
Prints arguments to stdout with a trailing newline.
println("Hello, world!")
println("x =", 42)
// Hello, world!
// x = 42
say(…args) -> null
Alias for println. Prints arguments followed by a newline. This is the idiomatic Forge output function.
say "Hello!"
say "The answer is", 42
yell(…args) -> null
Prints arguments in UPPERCASE followed by a newline.
yell "fire detected"
// FIRE DETECTED
whisper(…args) -> null
Prints arguments in lowercase followed by a newline.
whisper "QUIET PLEASE"
// quiet please
Notes
printandprintlnare classic-style.say,yell, andwhisperare Forge-style.- All five functions write to stdout (not stderr). For stderr output, use the
logmodule. - Arguments of any type are auto-converted to their string representation.