From da6d1c3b0ee150194dd6f106f59a5b878ebc52ac Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Sat, 5 Aug 2023 02:08:14 +1000 Subject: [PATCH] README.md formatting --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 6605b405..053b5514 100644 --- a/README.md +++ b/README.md @@ -7,40 +7,40 @@ BSD license ### Features - default ansi color output - toggle with 'colour on' and 'colour off' -- experimental functional/pattern-matching language features. (will not be performant until more work is done on script compilation) - e.g.1 basic pipeline with 2 segments - `var_pipe_output.= var_list.= list a b c |> string toupper` - e.g.2 basic pattern-match multi-assignment to variables x y & z +- experimental functional/pattern-matching language features. (will not be performant until more work is done on script compilation) + e.g.1 basic pipeline with 2 segments + `var_pipe_output.= var_list.= list a b c |> string toupper` + e.g.2 basic pattern-match multi-assignment to variables x y & z `x@0,y@1,z@2.= list a b c` equivalently: `x@,y@,z@.= list a b c` or even `x@,y@,z@= {a b c}` - `x/0,y/1,z/2,zz/3.= list a b c` is similar - but the use of forward-slash instead of @ will not produce a mismatch if an index is out of range. - where .= indicates following arguments form a command, and a plain = accepts only a single argument as a value - The diminutive case of this is `x= "something"` as equivalent to `set x "something"` - Assignment operations and pattern-matches are slightly optimised to bytecompile, but are unlikely to compete with raw Tcl commands performance-wise. - e.g.3 destructuring pattern-match. Get value of key 'k1' from last item in a list of dicts. - `x@end/@@k1.= list {k1 aaa} {k1 bb}` returns bbb + `x/0,y/1,z/2,zz/3.= list a b c` is similar - but the use of forward-slash instead of @ will not produce a mismatch if an index is out of range. + where .= indicates following arguments form a command, and a plain = accepts only a single argument as a value + The diminutive case of this is `x= "something"` as equivalent to `set x "something"` + Assignment operations and pattern-matches are slightly optimised to bytecompile, but are unlikely to compete with raw Tcl commands performance-wise. + e.g.3 destructuring pattern-match. Get value of key 'k1' from last item in a list of dicts. + `x@end/@@k1.= list {k1 aaa} {k1 bb}` returns bbb There are many more pattern-matching features yet to be documented. - easy execution of externals commands with return of stdout, stderr and the exitcode of the process - - `run ...` + - `run ...` (return exitcode of process - and allows process writes to stderr/stdout to appear in console as they occur) - - `runout ...` - (return stdout of process - no output until completion) - - `runerr ...` + - `runout ...` + (return stdout of process - no output until completion) + - `runerr ...` (return stderr of process - no output until completion) - `runx ...` (return a dict of stdout stderr exitcode - no output until completion) - namespace browser (contextual - allowing running of commands within the active namespace - analogous to 'cd' for directories) - - `n/` - display child namespaces of current namespace (alias `:/`) + - `n/` - display child namespaces of current namespace (alias `:/`) also `n/ ` to restrict output - - `n/ ` - if the argument doesn't contain glob chars '*' or '?' - attempt to switch to a child namespace of that name. Analogous to `cd ` + - `n/ ` - if the argument doesn't contain glob chars '*' or '?' - attempt to switch to a child namespace of that name. Analogous to `cd ` list any sub namespaces of the namespace we just switched to. - - `n//` - display child namespaces and commands (alias `://`) - with colourised indication of type such as proc,alias,ensemble,imported,exported where possible. + - `n//` - display child namespaces and commands (alias `://`) + with colourised indication of type such as proc,alias,ensemble,imported,exported where possible. (renamed aliases and builtins and commands loaded from binaries will appear unmarked) - `nn/` - move up one namespace towards root namespace '::' analogous to `cd ..` (alias `::/`) - `n/new ` - create a child namespace called 'somename' and switch to it in one operation. (alias `:/new`) - cross-platform alternative to cd & ls/dir without invoking child processes. Display colourised listing of dirs and folders - with vfs indication. - - `d/` - list current directory (alias `./`) + - `d/` - list current directory (alias `./`) also `d/ ` to restrict output - `d/ ` - switch to subdir and list contents in one operation - `dd/` - move up one directory and output listing. Roughly equivalent to `cd ..` followed by dir or ls (alias `../`)