BTC is born with the idea of transmit small quantity of data between two devices via Bluetooth. It's also inspired by JSON but tries to be more lightweight.
It's very important to specify that BTC supports mixed lists:
different data types can be included to the list, including more lists.
This data rappresentation is based on those 3 data types:
- Numbers
- Strings
- Booleans
There are few sintax rules, but they are very strict:
Elements
An ELEMENT is a child of Object. It is composed by TAG and VALUE
Each element must start with
@
TAGs are strings that can be composed by-
TAG is case sensitive
A TAG ends with>
character
Items
An ITEM is a child of List. It is a pure VALUE.
An item must ends with
,
character if it isn't the last in the list.
Strings
Strings are rappresented with: "my string"
There are some limitations:
Only UTF-8 characters can be used
The only special characters that can be rappresented are:
-\r
-\n
-\t
-\'
-\"
-\\
Numbers
Numbers are rappresented with a series of numbers (for example: 37.49
)
Booleans
Booleans are rappresented with true
or false
Complex types
Both complex types (List and Object) can be empty.
An Element is a basic pair between a TAG and DATA
@identifier-name > *
Where * can assume the following data types:
- Basic Datas:
- Numbers (Decimals and Integers)
- Strings
- Booleans
- Complex Datas:
- Objects
- Lists
An object is a structure composed of several Elements.
Object syntax
An Object starts with
(
and ends with)
Each item inside an Object IS an Element
(
@comp-a > 13
@comp-b > "Ajeje Brazorf"
@comp-c > true
)
Lists are compositions of Data.
List syntax
A List starts with
[
and ends with]
Each item in the List is separated by,
character
Each item in the List ISN'T an Element: IS a DATA
[
420.69,
"Mixed Type List",
(
@comp-a > "Wait. That's illegal."
@comp-b > "Ah, I see you're a developer of culture as well!"
@comp-c > true
),
[
"Wait. That's",
"Outstanding move",
"Behind science",
"*MEME's POWER INTESIFIES*"
]
]