Jump to content

Talk:User defined pipe and redirection operators: Difference between revisions

m
Line 76:
OP TAIL = (INT n)MANYTOONE: tail(n,);</lang>
 
Note that this "''tail''" implementation requires just one argument "n", keeping things simple to satisfy the use of tail in the "''Sample shell script''". I'm not asking for reinvention of head/tail etc, just enough to run the "''sample shell script''", basically a proof of concept thefor a particular language.
 
'''Rationale''': Pipes appear in a hoard of different languages. It always bugs me when a feature is '''cemented'' ininto a language and hence cannot enhanced. Being such a wide spread and useful concept, it would be nice to simply define a few new operators and have piping/redirection available in any other language.
 
Indeed, having to the ability to add pipes & redirections to a language means a coder can evolve the definition to match the environment. For example the pipe/redirection operators defined above are "[[Strong typing|string typed]]" (currently STRING), hence the compiler will detect data of the wrong type being piped and report a '''compile time''' semantic error, hence one [[Unit_testing|unit test]] just wrote itself!! (joy).
Cookies help us deliver our services. By using our services, you agree to our use of cookies.