I have to respectfully disagree, Charlie.
Shorthand is fine for interactive shell use, but will eventually bite you when used in reused/production code.
For example, this works in the Tcl 8.5.10 running on my CL server:
set mylist [lis aa bb cc]
if { [info e myKl] } {
set f [op /tmp/j.txt w]
put $f “length of mylist= [lle $mylist]”
close $f
}
But, it fails with an error in version 8.6.7 on my desktop:
unknown or ambiguous subcommand “e”: must be args, body, class, cmdcount, commands, complete, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars
Likewise, as soon as I define a new command that starts with “op”, my shorthand open command “op” is no longer unique.
So, I create this proc:
proc operationCloverleaf { } {
puts “this is a new command”
}
Then re-run my original code and get this error:
Error: ambiguous command name “op”: open operationCloverleaf
The same holds true for the lis, lle and put abbreviations I used. Even though they may work today, that doesn’t mean they’ll continue to do so over time.
So, for the sake of maintainability, any production code should have full command syntax. That way, when something changes in the future, it doesn’t unexpectedly break your old code.
Jeff Dinsmore
Chesapeake Regional Healthcare