Built-in Functions Reference

Explore the standard library functions available in GluonScript.

Module: core

fn append(list: List, element: Any): List

Returns a new list with the element passed as argument appended to it.

fn import(file: String): Record

Returns a record with all the functions exported by the module defined in file.

fn len(list: List): Int

Returns the length of a list.

fn slice(list: List, start: Int, end: Int): List

Returns a new list which is a slice of the list passed as argument, between index start and end.

Module: conv

fn float(string: String): Float

Returns a float by converting the string passed as argument.

fn int(string: String): Int

Returns an int by converting the string passed as argument.

fn string(any: Any): String

Returns a string by converting the type passed as argument into its string representation.

Module: env

fn args(): List

Returns a list with all the command line arguments passed into the script.

Module: http

fn get(url: String): Record { error: Bool, value: String }

Returns a result record with a boolean error and the server response from url as a string.

Module: io

fn input(): String

Returns a string with the content read from the standard input.

fn print(any: Any...): None

Prints every value passed as argument to the standard output.

fn println(any: Any...): None

Prints every value passed as argument to the standard output and appends a newline char.


This site uses Just the Docs, a documentation theme for Jekyll.