~robsimmons/Dusa#24: 
Support infix -> and prefix $ for dealing with JSON data

JSON is an interesting enough use case that I want to add intrinsic support for it. Plan is that instead of

edge A B :- 
    field _ "edges" is Edges,
    field Edges _ is AdjList,
    field AdjList 0 is A,
    field AdjList 1 is Neighbors,
    field Neighbors _ is B.

I should be able to write:

edge A B :-
    $$->"edges"->_ == AdjList
    A == AdjList->0,
    B == AdjList->_->B.

A -> B is C is a built-in default for when you import JSON data (In my AOC examples I always specified that the predicate was field.)

$ should be a tightly-binding prefix operation, $N is the Nth loaded JSON object.

$$ should always be equal to $0, for the common case where you're only loading one JSON object.

Status
RESOLVED DUPLICATE
Submitter
~robsimmons
Assigned to
No-one
Submitted
11 months ago
Updated
5 months ago
Labels
No labels applied.