John Saylor wrote:
> this flies in the face of one of the
> greatest strengths [and weaknesses] of perl: TMTOWTDI.

I wrote some additions to the Tk::TextUndo module
so that it could do "redo" and a bunch of other
textedit type features and worked with Nick Ing-Simmons
to roll them into the Tk release.

I then wrote a text editor script using perl called gedi.pl
It is included with the Tk release. And it is also demo'ed
in the Tk widget demo. if you have Tk800.015 installed,
just type "widget" at your command prompt to see the Tk
demos, scroll down to "User Contributed Demonstrations",
and click on the one that says 
"Gedi Master Advanced Text Editor" to run a demo of gedi.pl
(OK, I admit, its a cheesy name)

gedi.pl contains what I believe is one of the simplest
and most effective sanity style checks you can do.
It searches for matching parens, curly braces, and brackets,
and makes sure they line up (1) on the same line or
( 
 2
)
in the same vertical column (correcting for tabs)

This means that any missing dangling paren is immediately
detectable within an editor without actually parsing/executing
perl code. And detectable in a way that you know exactly
where it is missing.

( 1 /
   ( 2 + 3   <- missing right paren
 * 4
)
 <- perl parser says missing paren here

If perl tries to slurp in the above code, it will say
missing paren at the end of teh expression.
If you line up your parens vertically or horizontally,
you can quickly tell the the paren is missing after '3'.

this is really useful once you get many, many levels
of parens and one gets dropped somewhere in the middle.
Perl always reports the paren missing at the end.
but lining them up horz/vert can find them instantly
with a simple script or in gedi.pl

Unfortunately, this flies in the face of a common
coding style of

sub my_method {
        blahdy-blah-blah
}

So, if people want to get the word out to the perl
community, this one change would make paren searching
a thing of the past.

Oh, and try the demo, it's pretty neat.
its got column copy/cut/paste
and indent/unindent of selected blocks of text.

Greg
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to