From 1ab8db590b41ed86a2307258ccbb62a6652a4ae7 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Tue, 3 Oct 2023 04:19:33 +0200 Subject: [PATCH] typedb: add more advanced examples with dummy-polymorphism of cut / sort --- typedb | 56 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/typedb b/typedb index eee1593..ce1177c 100644 --- a/typedb +++ b/typedb @@ -24,30 +24,10 @@ ::seq \(-s\|--separator\) : [0-9]* <1: ~~~Char>~~ -::sort -n\( .*\)* ->0: ~~~Char>>~~ -<1: ~~~Char>>~~ - -::sort -M\( .*\)* ->0: >~~ -<1: >~~ - -::sort\( .*\)* ->0: >~~ -<1: >~~ - ::\(head\|tail\)\(\| .*\) >0: >~~ <1: >~~ -::cut -d[ ]*: -f[0-9]* ->0: >~~>~~ -<1: >~~ - -::cut -d[ ]*/ -f[0-9]* ->0: >~~>~~ -<1: >~~ - ::ls\( .*\)* -l\( .*\) <1: ~>~~ @@ -116,10 +96,46 @@ >0: >~~>~~ <1: ~~ℕ~~~Char>>~~ +::xargs -d[ ]*: stat -c %[WXYZ],%n +>0: >~~>~~ +<1: ~~ℕ~~~Char> ',' Path~>~~>~>~~ + ::xargs -d[ ]*: stat -c %[wxyz] >0: >~~>~~ <1: >~~ +::sort -t, -k1 -n +>0: ~~ℕ~~~Char> ',' Path~>~~>~>~~ +<1: ~~ℕ~~~Char> ',' Path~>~~>~>~~ + +::cut -d[ ]*, -f[ ]*1 +>0: ~~ℕ~~~Char> ',' Path~>~~>~>~~ +<1: ~~ℕ~~~Char>>~~ + +::cut -d[ ]*, -f[ ]*2 +>0: ~~ℕ~~~Char> ',' Path~>~~>~>~~ +<1: >~~>~~ + +::cut -d[ ]*: -f[0-9]* +>0: >~~>~~ +<1: >~~ + +::cut -d[ ]*/ -f[0-9]* +>0: >~~>~~ +<1: >~~ + +::sort -n\( .*\)* +>0: ~~~Char>>~~ +<1: ~~~Char>>~~ + +::sort -M\( .*\)* +>0: >~~ +<1: >~~ + +::sort\( .*\)* +>0: >~~ +<1: >~~ + ::xargs rm\( .*\)* >0: >~~>~~