Glich - v0.3.0 Manual
Built-in Objects
Home Development v0.3.0 Manual Glich Script Built-in Objects

Introduction

Glich has just one built-in object, the general purpose object with the code name ":" (colon).

There is also one built-in object function. This is available for all objects irrespective of the object definition.

Built-in Objects

General Purpose Object ":"

The {:} object can be used as a variable length array of values. Its definition is equivalent to the following statement.

object : {}
ExampleOutput
let x = {: 1,,3}; write x nl; x[4] = 5; write x nl; {: 1, null, 3}
{: 1, null, 3, null, 5}

Built-in Object Functions

FunctionDescription
object_type @mask( object_type )Overlays one object value on another.
object_type @sizeReturn the number of elements.
object_type @obj:nameReturn the code name of the object as a string.
object_type @obj:listReturn object values as a string.

Object Function ovalue @mask( value )

The elements of the value object are used to replace any values in the calling ovalue object that are of type null.

The length and object definition do not need to match.

ExampleOutput
let x = {: 1,,3,,5}; write x nl; x = x @mask( {: 10, 20, 30} ); write x nl; x = x @mask( {: ,,,400,500,600} ); write x nl; {: 1, null, 3, null, 5}
{: 1, 20, 3, null, 5}
{: 1, 20, 3, 400, 5, 600}

Object Function ovalue @size

Return the number of elements.

ExampleOutput
{: 1, 2, 3}@size3

Object Function ovalue @obj:name

Return the code name of the object as a string.

ExampleOutput
{test 1, 2, 3}@obj:name"test"

Object Function ovalue @obj:list

Return an annotated list of an objects contents as a string, one line per value.

ExampleOutput
object test { values first second; } {test "One hundred", 101, 102}@obj:listfirst = "One hundred"
second = 101
2 = 102
Home Development v0.3.0 Manual Glich Script Built-in Objects

Managed by WebPageLayout Validated by HTML Validator (based on Tidy)

5th October 2023