On Sun, May 26, 2013 at 11:32 AM, A. P. Garcia
<[email protected]> wrote:
> on Sun, 26 May 2013 12:55:33 +0200, Irek Szczesniak wrote:
>
> <snip>
>
>> haven't you read Roland Mainz's comments about passing compound
>> variables via pipe or network sockets? ksh93 already has a powerful
>> (much more feature rich in what PowerShell can do) mechanism with
>> that, and only at the beginning or the end a conversion from or to
>> XML/JSON might be useful. In between the compound variable mechanism
>> is much faster and flexible.
>
> i read it, but before that i was unaware of compound variables, so i
> don't really know their capabilities. in roland's demo, though, it
> seemed rather like he was passing a struct (just data). in this
> regard, henk's comments, which you cited, are very interesting: "If
> you think about it, the concept of the unix command as a 'filter' is
> akin to functional programming; they consume input (stdin+parameters),
> produce output, and leave no side-effects."
>
> where he refers to functional programming, think first class
> functions. think currying. think objects as data plus functions that
> operate on that data. then combine them, rather like ocaml. is that
> what i want in a shell? i don't know, but it sure sounds like fun,
> which is a wonderful quality to have in computing, as well as utility.
> in the end, perhaps fun is what really sets unix apart.

The object serialization is mostly through print's -C or -v, read -C, or just
expand objects as ordinary parameters. These output data members but not
function members. I don't know why. There are no higher-order functions, you
still need eval. I could never get binary serialization to work, and -C is
broken in many cases. I did partial() here -- {,un}curry should be pretty
close.
http://wiki.bash-hackers.org/commands/builtin/eval#higher-order_functions

Most AST utilities can't produce or consume ksh compound variable format.
Powershell has the whole .net framework to work with. No Unix shell has a
library like that. Maybe have a look at scsh. Sadly it doesn't get
much interest.

--
Dan Douglas
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to