Types and Data Structures

RuLA supports four fundamental types for working with data:

Type
Description
Example

Text values

"Hello World"

Numeric values (integers and decimals)

42, 3.14

Ordered collections of values

['a', 'b', 'c']

Key-value pairs

{'name': 'John', 'age': 30}

Each type has its own syntax for creation, specific operators for manipulation, and built-in functions for common operations.

Quick Reference

Creating Values

"This is a string"      # String
42                      # Number
3.14159                 # Number
['apple', 'banana']     # List
{'x': 1, 'y': 2}        # Dictionary

Common Operations

Operation
Strings
Numbers
Lists
Dictionaries

Check if empty

LEN(text) == 0

-

list == []

dict == {}

Access by index/key

text[index]

-

list[index]

dict[key]

Check containment

text contains "x"

-

Last updated

Was this helpful?