4590142 [rkeene@sledge /home/rkeene/projects/rivet-cgi/rivet-tcl]$ cat -n lempty.tcl
   1: ###
   2: ## lempty <list>
   3: ##
   4: ##    Returns 1 if <list> is empty or 0 if it has any elements.  This command
   5: ##    emulates the TclX lempty command.
   6: ###
   7: 
   8: proc lempty {list} {
   9:     if {[catch {llength $list} len]} { return 0 }
  10:     return [expr $len == 0]
  11: }
4590143 [rkeene@sledge /home/rkeene/projects/rivet-cgi/rivet-tcl]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2002-04-17 19:24:54