EON


Introduction Notation Accessors Commands Grammar
tree: employee{ red_team name: "Michael Scott" title: "Regional Manager"
  /[
    employee{ red_team name: "Dwight Scrute" title: "Assistant to the Regional Mgr"}
    employee{ blue_team name: "Jim Halpert" 
      title: "Head of Sales" 
      top_customers: [
        customer{ first_name: "John" last_name: "Doe" orders_placed: 4500 }
        customer{ first_name: "Jane" last_name: "Doe" orders_placed: 2300 }]
      /[
        employee{ red_team name: "Andy Bernard" 
          title: "Sales Rep"
          top_customers: [
            customer{ first_name: "Sam" last_name: "Winchester" orders_placed: 1000 }
            customer{ first_name: "Dean" last_name: "Winchester" orders_placed: 5 }]}
        employee{ blue_team name: "Phyllis Lapin" 
          title:"Sales Rep"
          top_customers: [
            customer{ first_name: "Hansel" last_name: "Schmidt" orders_placed: 500 }
            customer{ first_name: "Gretel" last_name: "Schmidt" orders_placed: 630 }]}]}
    employee{ blue_team name: "Pam Beesly" title: "Office Administrator"}
  ]}

The card accessor examples below use the above data named tree.


Key-value pairs in the index are accessed using . followed by their name.
tree.name
/* returns:
"Michael Scott"
*/

All of the keys/tags in an card can be retrieved as a list using *.
tree* 
/* returns: 
[ "red_team" "name" "title" ]
*/

An accessor can target multiple keys, types, or indexes in an card by grouping them into a list using the accessor followed by a list of the keys. This is comparible to a logical OR.
tree.["name" "title"] 
/* returns: 
[ "Michael Scott" "Regional Manager" ]
*/

A list or array's listed items are accessed using / followed by the item index. Numerical indexing starts at 1 not 0 because indexes are not offsets.
tree/1 
/* returns: 
employee{ 
  red_team
  name: "Dwight Scrute" 
  title: "Assistant to the Regional Mgr"}
*/

The body of a card can be retrieved without any tags by using the / accessor. If the data is a primitive this will remove the type and convert the primitive to a byte array.
integer: 511
integer/
// returns [:255 1]

Tags in a card are checked using . followed by their name.
tree.red_team
/*
does not return void
(other reader implementations may use 
true/false with this example returning true)
*/

A card's type can be retrieved using #.
tree#
/* returns:
employee
*/

Lists of cards can be filtered by type into a smaller list of cards using # followed by the type name. So to see a list of the names of jim's employees:
tree/2#employee.name 
/* returns: 
["Andy Bernard" "Phyllis Lapin"]
*/

A whole list of cards in a card can be selected and filtered by tag/key into a list of smaller cards using @ followed by each the key/tag/index to be selected from each card. So to see a list of jim's employees' top customer lists:
tree/2@top_customers
/* returns: 
[
  [
    customer{ first_name: "Sam" last_name: "Winchester" orders_placed: 1000 }
    customer{ first_name: "Dean" last_name: "Winchester" orders_placed: 5 }]
  [
    customer{ first_name: "Hansel" last_name: "Schmidt" orders_placed: 500 }
    customer{ first_name: "Gretel" last_name: "Schmidt" orders_placed: 630 }]]
*/


Introduction Notation Accessors Commands Grammar