# Concepts - Data Type

## Data Type

• integer (int64)
• double (float64)
• string
• bool
• null
• undefined
• list
• object

# Concepts - Expression

## Expression

• exp ::= false or true
• exp ::= Numeral
• exp ::= LiteralString (double quoted)
• exp ::= functiondef
• exp ::= tableconstructor
• exp ::= exp binop exp
• exp ::= unop exp
• tableconstructor: {a, b, c} or {a=”x”, b, c=1}

# Concepts - Operators

## Arithmetic Operators

• -: subtraction
• *: multiplication
• /: float division
• %: modulo
• ^: exponentiation
• -: unary minus

## Bitwise Operators

• &: bitwise AND
• |: bitwise OR
• ~: bitwise exclusive OR
• >>: right shift
• «: left shift
• ~: unary bitwise NOT

## Relational Operators

• ==: equality
• ~=: inequality
• <: less than
• >: greater than
• <=: less or equal
• >=: greater or equal

These operators always result in false or true.

# Concepts - Function

## stream

The data processing commands, such as `aggregate`,`search`, `where`, cannot be used twice in one module of FPL code. Multiple purposes can be achieved by wrapping the corresponding codes into multiple functions. The syntax is:

``````function FunctionName()
expression...
end
stream Output=FunctionName()
``````

The `stream` argument is used to call the function.

See details and examples: stream

## env

If one piece of FPL code contains more than one functions, `env`, which means “environmental variable”, can be used to set a sharing time range, type, query or timezone before call the functions.

See details and examples: env

# Concepts - Allocation

## let

In FPL language, there’s not `A=...(B)`. Instead, the expression is:

• let <NAME = expression>, …
• declare a “stream variable”.
• stream variable could be extracted from the incoming event or from math/string manipulations over existing stream variables
• stream variable can also originate from aggregation function or groupby expression.
• stream variable can only be assigned once. assign a = a+1 is not allowed.
• stream variable will terminate after aggregation pipe.

The command `let` can be used on both data selection and processing.

See details and examples: let