<commit_before>## MalerScript Documentation

* [Comments](#comments)
* [Types](#types)
* [String functions](#string-functions)
* [Date functions](#date-functions)
* [Number functions](#number-functions)
* [Boolean functions](#boolean-functions)

### <a name="comments"></a>Comments

Comments may be used to provide informative annotation for an expression. Comments are lexical constructs only, and do not affect expression processing.

Comments are strings, delimited by the symbols `/*` and `*/` or `//`. The former may span multiple lines, the latter may not. Comments may be nested.

A comment may be used anywhere ignorable whitespace is allowed.

The following is an example of a multi-line comment:

    /* Houston, 
    we have a problem */

And a single-line:

    // TODO

### <a name="types"></a>Types

MalerScript includes six (6) data types: Boolean, Number, String, Array, Dictionary and Function.

<a name="boolean"></a>**Term:** **Boolean**

An object of type boolean can have one of two values, true and false.

    true

    false

<a name="number"></a>**Term:** **Number**

A number represents a floating-point number. A number can have any double-precision 64-bit format [IEEE 754](http://www.w3.org/TR/xpath/#IEEE754) value.

The numeric operators convert their operands to numbers as if by calling the [`Number`](#fn-number) function.

    42

    3.14

    1.6E-35

<a name="string"></a>**Term:** **String**

Strings consist of a sequence of zero or more [Unicode](http://www.unicode.org/ "Unicode Consortium") characters.

    'Evil will always triumph, because good is dumb.'    

    "It's not a tumor!"

<a name="array"></a>**Term:** **Array**

TODO

<a name="dictionary"></a>**Term:** **Dictionary**

TODO

<a name="function"></a>**Term:** **Function**

TODO

### <a name="string-functions"></a>String Functions

<a name="fn-string"></a>**Function:** *string* **String**(*object?*)

The `String` function converts an object to a string as follows:

* A number is converted to a string as follows:
    * NaN is converted to the string `NaN`
    * positive zero is converted to the string `0`
    * negative zero is converted to the string `0`
    * positive infinity is converted to the string `Infinity`
    * negative infinity is converted to the string `-Infinity`
    * if the number is an integer, the number is represented in decimal form as a Number with no decimal point and no leading zeros, preceded by a minus sign (-) if the number is negative
    * otherwise, the number is represented in decimal form as a Number including a decimal point with at least one digit before the decimal point and at least one digit after the decimal point, preceded by a minus sign (-) if the number is negative; there must be no leading zeros before the decimal point apart possibly from the one required digit immediately before the decimal point; beyond the one required digit after the decimal point there must be as many, but only as many, more digits as are needed to uniquely distinguish the number from all other IEEE 754 numeric values.
  
* The boolean false value is converted to the string `false`. The boolean true value is converted to the string `true`.
* TODO Array
* TODO Dictionary
* TODO Subroutine
* If the argument is omitted, it returns the empty string.

**NOTE:** The [`String`](#fn-string) function is not intended for converting numbers into strings for presentation to users. The [`format-number`](#fn-format-number) function provides this functionality.<commit_msg>* doc<commit_after>## MalerScript Documentation

* [Comments](#comments)
* [Types](#types)
* [String functions](#string-functions)
* [Date functions](#date-functions)
* [Number functions](#number-functions)
* [Boolean functions](#boolean-functions)

### <a name="comments"></a>Comments

Comments may be used to provide informative annotation for an expression. Comments are lexical constructs only, and do not affect expression processing.

Comments are strings, delimited by the symbols `/*` and `*/` or `//`. The former may span multiple lines, the latter may not. Comments may be nested.

A comment may be used anywhere ignorable whitespace is allowed.

The following is an example of a multi-line comment:

    /* Houston, 
    we have a problem */

And a single-line:

    // TODO

### <a name="types"></a>Types

MalerScript includes six (6) data types: Boolean, Number, String, Array, Dictionary and Function.

<a name="boolean"></a>**Term:** **Boolean**

An object of type boolean can have one of two values, true and false.

    true

    false

<a name="number"></a>**Term:** **Number**

A number represents a floating-point number. A number can have any double-precision 64-bit format [IEEE 754](http://www.w3.org/TR/xpath/#IEEE754) value.

The numeric operators convert their operands to numbers as if by calling the [`Number`](#fn-number) function.

    42

    3.14

    1.6E-35

<a name="string"></a>**Term:** **String**

Strings consist of a sequence of zero or more [Unicode](http://www.unicode.org/ "Unicode Consortium") characters.

    'Evil will always triumph, because good is dumb.'    

    "It's not a tumor!"

<a name="array"></a>**Term:** **Array**

Arrays are an ordered sequence of other objects of any type (including other arrays).

    [false, 'eins', 'zwei', 'drei', 4, 5.0]

    [] // an empty array

<a name="dictionary"></a>**Term:** **Dictionary**

Dictionaries are name/value pairs that offer efficient storage and lookup by name.

    {'name': 'Todd', 'age':39, 'male': true}

    {} // an empty dictionary

<a name="function"></a>**Term:** **Function**

Functions are callable portions of a program which can return a value. In MalerScript, all functions are objects.

    sub getName(dict) {
        var name = dict['first_name'] || " " || dict['last_name']
        return name
    }

### <a name="string-functions"></a>String Functions

<a name="fn-string"></a>**Function:** *string* **String**(*object?*)

The `String` function converts an object to a string as follows:

* A number is converted to a string as follows:
    * NaN is converted to the string `NaN`
    * positive zero is converted to the string `0`
    * negative zero is converted to the string `0`
    * positive infinity is converted to the string `Infinity`
    * negative infinity is converted to the string `-Infinity`
    * if the number is an integer, the number is represented in decimal form as a Number with no decimal point and no leading zeros, preceded by a minus sign (-) if the number is negative
    * otherwise, the number is represented in decimal form as a Number including a decimal point with at least one digit before the decimal point and at least one digit after the decimal point, preceded by a minus sign (-) if the number is negative; there must be no leading zeros before the decimal point apart possibly from the one required digit immediately before the decimal point; beyond the one required digit after the decimal point there must be as many, but only as many, more digits as are needed to uniquely distinguish the number from all other IEEE 754 numeric values.
  
* The boolean false value is converted to the string `false`. The boolean true value is converted to the string `true`.
* TODO Array
* TODO Dictionary
* TODO Subroutine
* If the argument is omitted, it returns the empty string.

**NOTE:** The [`String`](#fn-string) function is not intended for converting numbers into strings for presentation to users. The [`format-number`](#fn-format-number) function provides this functionality.
{'fraction_non_alphanumeric': 0.10793272414249769, 'fraction_numerical': 0.007018937889021322, 'mean_word_length': 4.123473541383989, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '558984', 'n_tokens_mistral': 2094, 'n_tokens_neox': 1954, 'n_words': 982}