linksplatform / Data.Doublets

LinksPlatform's Platform.Data.Doublets Class Library
https://linksplatform.github.io/Data.Doublets/
The Unlicense
14 stars 6 forks source link

Introducing the () operator for explicit association indication in code #383

Open Konard opened 1 year ago

Konard commented 1 year ago

@netkeep80 proposes to add the () operator for explicitly associating data in text markup. For example:

"11" = "1"("1")

The relative addressing operator already exists [], but it assumes addressing in a map, whereas the () operator would be used for defining tuples.

The advantage of using () is that the syntax precisely indicates which data is associated with each other. For example:

1(2(3)) != 1(2)(3)

We can use either the () operator or [], the main thing is that the semantics are clearly distinct in a single context. If we are talking about an API, we can use the () operator. If we are talking about a relationship name, we can use the [] operator, for example:

"abc[def][point[x]]" "calc[window][x]"