Hi all, I was getting tired of chasing down parenthesis in nested map, split, join, map,map,map type of operations and thinking about how ruby and python express these in more of a chained/pipe syntax due to their builtin list objects (and how they seem to get it just slightly wrong (this is not your cue to start a language flame war.))
So, I looked around on CPAN a little and found a few modules that might work, but of course none of which had everything I was trying to accomplish and so I decided to throw this together. http://scratchcomputing.com/svn/list/trunk/lib/list.pm Maybe some of you are interested and/or have some good suggestions. The main differences between this and the other list/array modules: o The reform() method which allows you to call a subroutine in the middle of the chain which operates on the entire list and not just each element. o l_push, l_pop, l_shift, l_unshift inline head/tail methods which allow insertion and deletion in a chain of calls o importable L() constructor for terse L(@array)->method(...) syntax o object is just a blessed array ref, so @{$obj} flattens it (though I think I'll add a flatten() method to enable that as a postfix rather than wrapped syntax. See the t/samples.pl file for some example usage. It's quite possible that I've missed some module on CPAN which has all of these features. If so, please point it out to me. Also, please note that this is mostly an experiment in syntax. If you think it is useful, that's awesome and I'll take suggestions and put it on CPAN. If you think it's absolutely stupid, that's awesome too, but please say so and give reasons. I'm sure it is still missing something, I've only been using it for an hour now. Thanks, Eric -- The opinions expressed in this e-mail were randomly generated by the computer and do not necessarily reflect the views of its owner. --Management --------------------------------------------------- http://scratchcomputing.com ---------------------------------------------------
