# jtclutils.tcl - general utilities that don't require Tk
#
######################################################################
# Copyright 1992-1995 by Jay Sekora.  This file may be freely        #
# distributed, modified or unmodified, for any purpose, provided     #
# that this copyright notice is retained verbatim in all copies and  #
# no attempt is made to obscure the authorship of this file.  If you #
# distribute any modified versions, I ask, but do not require, that  #
# you clearly mark any changes you make as such and that you provide #
# your users with instructions for getting the original sources.     #
######################################################################

######################################################################
# j:default var value - set var to value only if it's not set already,
#   returning $var
######################################################################

proc j:default { var value } {
  if ![uplevel 1 [list info exists $var]] {
    uplevel 1 [list set $var $value]
  }
  return [uplevel 1 [list set $var]]
}
