Introduction
Arr.ai is many things, but it is first and foremost a data representation and transformation language. This section provides a complete reference of its syntax and features.
If you're new to arr.ai, you may want to start with Getting Started and Tutorial sections.
#
About the nameThe domain name arr.ai was available and there was some irony in the fact that a language called arr.ai doesn't have arrays (though it kind of does; see below).
#
Some lexical conventionsArr.ai has a rich syntax, which we won't dive into just yet. A few elements are worth covering upfront to aid comprehension below.
Identifiers: Parameter and variables names start with
_
,@
,$
or a Unicode letter, and may continue with a sequence of any of these and Unicode decimal numbers.Examples:
x
,$y
,Username
,i0
,@j12
,apple_ฯ
The identifier
.
is a special case. It is often used as a default argument in transform expressions.Keywords: The following names are predefined and cannot be reassigned as parameter or variable names:
true
,false
,let
Comments: Comments start with a
#
and end at the end of the line.Example:
# Comment on comments.
Offset collections: In the string
"hello"
, the first character,h
, is at position zero. In the alternate form12\"hello"
, theh
is at position 12 and the remaining characters occupy positions 13โ16. This is known as an offset-string. Likewise,5\[1, 2, 3]
represents an offset array.