2 ms·
Cool. To address one of your other comments: "but the former retains the compatibility with all the tools that don't know the structure." Marcel plays nicely
by geophile 3y ago
Cool.
To address one of your other comments: "but the former retains the compatibility with all the tools that don't know the structure."
Marcel plays nicely with host executables. The strings generated by an executable can be streamed into marcel commands. Marcel structured output can be piped into executables as strings.
Example 1: Compute distribution of word lengths. This pipes cat output into marcel commands:
cat /usr/share/dict/words | (w: (len(w), 1)) | red . + | sort
(Or you could replace cat by the marcel command "read".)
Example 2: Generate tuples of the form (i, i) and then have sed work on them.
gen 10 | (x: (x, x)) | sed s/5/xxx/g
The (5, 5) tuple is replaced by (xxx, xxx)