Re:You already use Lisp syntax
by zokier on Wednesday May 21, 2014 @07:05AM
(#7777572)
I though a pipeline would be more idiomatic way of doing this in bash. But my initial attempt resulted quite unreadable mess:
Is there any way of making that more readable? My variation of the C utility source code is here: https://gist.github.com/zokier/c55e9c9736009981b494
[ Parent
| on HN ]
Re:You already use Lisp syntax
by captainmuon on Wednesday May 21, 2014 @07:33AM
(#7777656)
Let the operators take one argument?
# 2*((10+4)/7)
$ echo 10 | add 4 | divide-by 7 | times 2
4I do like that, it also makes the utility more filter-like. Here is that implemented in C: https://gist.github.com/zokier/6b43032afb248bef68b7