Anonymous user
Talk:User defined pipe and redirection operators: Difference between revisions
Talk:User defined pipe and redirection operators (view source)
Revision as of 03:26, 13 September 2011
, 12 years ago→Yet another task without a task: another reword.
m (→Yet another task without a task: reword.) |
m (→Yet another task without a task: another reword.) |
||
Line 14:
Adhere to the syntax of the specific language where required, eg the use of brackets and names of operators.
For example: I had to use the operator "=:" instead of
Here is the "''Sample shell script''", but rewritten in Algol.
Line 48:
This task should be OK in python, especially the operators, and also Ada. I figure the GNU C has a fair chance. C++ should be able to handle the operator overloading.
I'm not familiar enough with other languages to make any real comment. [Ocaml can do any thing! (apparently)] :-) ... Go should be real interesting!
BTW: Here is a complete implementation of "''tail''", notice it uses a sliding window:
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''".
'''Rationale''': Pipes appear in a hoard of different languages. It always bugs me when a feature is '''cemented''' into 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
Indeed, having to the ability to add pipes & redirections to a language means a coder can evolve the pipe/redirection definition to match the environment. For example the pipe/redirection operators defined above are "[[Strong typing|string typed]]" (currently
[[User:NevilleDNZ|NevilleDNZ]] 03:
|