CorLang

Logo

View the Project on GitHub C1200/CorLang

← Back

Table of Contents

Built-In Variables

Variable Type Info
null Number Equal to 0
true Number Equal to 1
false Number Equal to 0

Built-In Functions

print(text)

Prints input to the screen.

print("Hello, World!")

input(text)

Prompts user for string input.

var my_input = input("Input some text: ")
print("Got some input: " + my_input)

input_int(text)

Prompts user for integer input.

var a = input_int("Input a number: ")
var b = input_int("Input another number: ")
print(a + b)

type(value)

Returns type of input.

type("a string") # Output: "String"
type([true, "truthy", 3.141, 10]) # Output: "List"

import(file)

Version >= 0.0.4

Imports exteral file.

import("std.list")
import("mymodule.cor")

See also: Modules & Imports

len(value)

Version >= 0.0.4

Returns the length of a list or string.

len("Hello") # Outputs: 5
len(["this", "has", "4", "elements"]) # Outputs: 4

throw(text)

Version >= 0.0.4

Throws a runtime error.

throw("An error occurred")