Looking for balanced critique of Perl

Peter da Silva peter at ficc.ferranti.com
Fri Jun 29 02:13:05 AEST 1990


In article <103428 at convex.convex.com> tchrist at convex.COM (Tom Christiansen) writes:
> I don't know that I'd be thrilled to see Xlib built into perl, and
> while I know Larry's adding curses, or at least providing the ability
> to do so, I wonder how well this will work out.  I'm concerned about
> efficiency and ease of coding of these things.  Will the ability to 
> patch in your own C functions cause people to turn from C in cases
> where this is not honestly merited?

One thing I have found useful is John Ousterhout's TCL: Tool Command
Language. It's designed to add an extension language to various tools
and (at least in the original, and in Karl Lehenbauer's AmigaTCL version)
uses an RPC mechanism to communicate between separate programs. This way
no individual program becomes a kitchen-sink.

I have published, to the net, a version of my "browse" directory browser
with a TCL interface. It's a nice clean language (sort of like a text-
oriented Lisp), and adding extensions to it is amazingly easy. Here's
a section of my browse.rc:

proc key_'K' {} {
	browse message {Edit key }
	set key [get key]
	set func key_[get keyname $key]
	set file [get env HOME]/.function
	if { [length [info procs $func] ] != 0 } {
		set def [list proc $func {} [info body $func]]
	} else {
		set def [list proc $func {} { ... }]
	}
	print $def\n $file
	browse message !vi $file
	browse shell [concat vi $file]
	source $file
}

proc key_'F' {} {
	set func [get response {Edit function }]
	if { [length $func chars] == 0 }
		return
	set file [get env HOME]/.function
	if { [length [info procs $func] ] != 0 } {
		set def [list proc $func {} [info body $func]]
	} else {
		set def [list proc $func {} { ... }]
	}
	print $def\n $file
	browse message !vi $file
	browse shell [concat vi $file]
	source $file
}

proc key_'d' {} {
	if { [string compare d [get key -d-]] == 0 } {
		set file [get file .]
		set prompt [concat Delete $file {? }]
		if { [string match {[yY]} [get key $prompt]] } {
			if { ![eval [concat browse delete $file]] } {
				perror
			}
		}
	}
}
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.
<peter at ficc.ferranti.com>



More information about the Comp.unix.wizards mailing list