lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


--- Kurt Jung <kurt.jung@michigancat.com> wrote:
>Perhaps we could revamp the lua standalone to accept a command line
>argument which would put it into "awk mode". 

TREE TRAVERSAL
Perhaps lua libraries could be provided that would not only read line by line but also traverse a tree with line-by-line traversal being a special case of tree traversal. That way, you could traverse an XML or HTML document in a logical fashion.  Perhaps some ideas could be borrowed from XSLT and the Perl HTML::TreeBuilder module.

PERL 6 REGEXPS
Also I understand that the regular expressions in Perl 6 will be expanded to allow matching of a much more general class of grammars.  This might be an opportune time to consider that too.

THE MARKET GAP
One other idea.  It may be best to leave awk as the undisputed champion of one-liners.  Consider the following awk expression which only prints out the first occurrence of any line in a file:

   awk '!x[$0]++'

Its going to be pretty hard to get more concise than that. Instead, in positioning Lua against awk, it would be positioned against awk programs that have grown beyond a one liner.  Awk would retain the "low end", while Lua would fill the gap that forms the middle ground between awk and Perl/Python/Ruby.  

COMMAND LINE SWITCHES
Finally, regarding perl's numerous awk-mode switches, I personally have always found them bewildering rather than simplifying.  I am not sure that the implementation should be an awk "mode" or just lua libraries that make awk-style processing easy.



_____________________________________________________________
Get your own FREE e-mail account at http://www.volcanomail.com

_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag