clink 1.7.1

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global clink --version 1.7.1                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local clink --version 1.7.1                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=clink&version=1.7.1                
nuke :add-package clink --version 1.7.1                

clink (CLInk cLINK), a CLI tool to manipulate links using single substitution operation.

It is based on associative theory (in Russian) and Links Notation (ru)

Short description in English in what links are. And in Russian.

<img width="727" alt="Screenshot 2024-12-15 at 23 30 17" src="https://github.com/user-attachments/assets/b7167eba-2bb8-4199-bfb4-f114af209907" />

This tool provides all CRUD operations for links using single substitution operation (ru) which is turing complete.

Each operations split into two parts:

(matching / restriction pattern)
(substitution pattern)

When match pattern and substitution pattern are essensially the same we get no changes (no operation), it may seem like it does not any write, but it actually does read.

For example this operation:

((1: 1 1)) ((1: 1 1))

will output:

(1: 1 1) ↦ (1: 1 1)

That is change of 1-st link with start (source) at itself and end (target) at itself to itself. Meaning no change, but as match pattern applies only to the link with 1 as index, 1 as source and 1 as target, this "no change" can be used as read query.

Creation is just a replacement of nothing to something:

() ((1 1))

Where first () is just empty sequence of links, that symbolizes nothing. And ((1 1)) is a sequence of link with 1 as a start and 1 as end, the index is undefined so it for database to decide actual available id (index).

Deletion is just a replacement of something to nothing:

((1 1)) () 

Where ((1 1)) is a sequence of match patterns, with a single pattern for a link with 1 as a start and 1 as end, the index is undefined, meaning it can be any index. It will match only existing link, if no such link found there will be no match. Last () is just empty sequence of links, that symbolizes nothing. We don't have matched link on the right side, meaning it will be effectively deleted.

And the update is substitution itself, obviously.

((1: 1 1)) ((1: 1 2))

In that case we have a link with 1-st id on both sides, meaning it is not deleted and not created, it is changed. In this particular example with change the target of the link (its ending) to 2. 2 is ofcourse id of another link. In here we have only links, nothing else.

Install or update from NuGet

If you have .NET installed you can install clink as a global CLI tool.

dotnet tool install --global clink

Create link with 1 as source and 1 as target.

clink '() ((1 1))'

(0: 0 0) ↦ (1: 1 1)
(1: 1 1)

Create link with 2 as source and 2 as target.

clink '() ((2 2))'

(0: 0 0) ↦ (2: 2 2)
(1: 1 1)
(2: 2 2)

Create two links at the same time: (1 1) and (2 2).

clink '() ((1 1) (2 2))'

(0: 0 0) ↦ (2: 2 2)
(0: 0 0) ↦ (1: 1 1)
(1: 1 1)
(2: 2 2)
clink '((($i: $s $t)) (($i: $s $t)))'

(1: 1 1) ↦ (1: 1 1)
(2: 2 2) ↦ (2: 2 2)
(1: 1 1)
(2: 2 2)

Where $i stands for variable named i, that stands for index. $s is for source and $t is for target.

Update link with index 1 and source 1 and target 1, changing target to 2.

clink '((1: 1 1)) ((1: 1 2))'

(1: 1 1) ↦ (1: 1 2)
(1: 1 2)
(2: 2 2)

Update link with index 1 and source 1 and target 1, changing target to 2.

clink '((1: 1 1) (2: 2 2)) ((1: 1 2) (2: 2 1))'

(1: 1 1) ↦ (1: 1 2)
(2: 2 2) ↦ (2: 2 1)
(1: 1 2)
(2: 2 1)

Delete link with source 1 and target 2:

clink '((1 2)) ()'

(1: 1 2) ↦ (0: 0 0)
(2: 2 2)

Delete link with source 2 and target 2:

clink '((2 2)) ()'

(2: 2 2) ↦ (0: 0 0)
clink '((1 2) (2 2)) ()'

(1: 1 2) ↦ (0: 0 0)
(2: 2 2) ↦ (0: 0 0)
clink '((* *)) ()'

(1: 1 2) ↦ (0: 0 0)
(2: 2 2) ↦ (0: 0 0)

Complete examples:

clink '() ((1 1) (2 2))'

clink '((1: 1 1) (2: 2 2)) ((1: 1 2) (2: 2 1))'

clink '((1 2) (2 1)) ()'
clink '() ((1 2) (2 1))'

clink '((($index: $source $target)) (($index: $target $source)))'

clink '((1: 2 1) (2: 1 2)) ()'

For developers and debugging

Execute from root

dotnet run --project Foundation.Data.Doublets.Cli -- '(((1: 1 1) (2: 2 2)) ((1: 1 2) (2: 2 1)))'

Execute from folder

cd Foundation.Data.Doublets.Cli
dotnet run -- '(((1: 1 1) (2: 2 2)) ((1: 1 2) (2: 2 1)))'

Complete examples:

dotnet run --project Foundation.Data.Doublets.Cli -- '() ((1 1) (2 2))'

dotnet run --project Foundation.Data.Doublets.Cli -- '((1: 1 1) (2: 2 2)) ((1: 1 2) (2: 2 1))'

dotnet run --project Foundation.Data.Doublets.Cli -- '((1 2) (2 1)) ()'
dotnet run --project Foundation.Data.Doublets.Cli -- '() ((1 2) (2 1))'

dotnet run --project Foundation.Data.Doublets.Cli -- '((($index: $source $target)) (($index: $target $source)))'

dotnet run --project Foundation.Data.Doublets.Cli -- '((1: 2 1) (2: 1 2)) ()'
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.8.0 43 12/21/2024
1.7.4 41 12/21/2024
1.7.3 36 12/21/2024
1.7.1 35 12/21/2024
1.7.0 39 12/21/2024
1.6.0 89 12/15/2024
1.5.0 73 12/15/2024
1.4.1 73 12/15/2024
1.4.0 79 12/15/2024
1.3.1 73 12/15/2024
1.3.0 68 12/15/2024
1.2.3 80 12/7/2024
1.2.0 87 12/7/2024
1.1.0 86 12/7/2024
1.0.1 87 12/5/2024
1.0.0 84 12/4/2024