XiRCON wasn't following the Tcl style guide.  It was placing it's
extensions (commands) in the global namespace.  The global namespace
is reserved for the core.  In 7.6, this was done by placing a prefix
on the command name like how I did for falcon.dll.  All those commands
started with FALC_.  The Tcl 8.x way is to use namespaces.  So I placed
all the XiRCON commands in ::IRC.

I also changed the way hooks run.  The old way, hooks eval'd globally.
I never liked how it left temporary variables around after the hook
finished running.  If you want a variable to be global, you should be
explicit about it.  Now I have them running like a proc and also in the
::IRC namespace.

http://www.cogent.net/~duquette/tcl/namespaces.html


I'm too lazy to write a complete tutorial about the changes I made to
XiRCON.  Here's a simplified example:

what was in the old XiRCON:

  set my_flag off

  on SOMEEVENT {
    set dest [lindex [args] 0]
    set msg [lindex [args] 1]
    my_filter $dest $msg
  }

  proc my_filter {towho what} {
    global my_flag
    if {$towho == [my_nick] && $my_flag} {
      echo $msg
      complete
    }
  }

Could be this if you want your script within it's own namespace:

  namespace eval ::myscript {
    variable my_flag off
  }

  IRC::on SOMEEVENT {
    set dest [lindex [args] 0]
    set msg [lindex [args] 1]
    ::myscript::my_filter $dest $msg
  }

  proc ::myscript::my_filter {towho what} {
    variable my_flag
    if {($towho == [::IRC::my_nick]) && $my_flag} {
      ::IRC::echo $msg
      ::IRC::complete
    }
  }

In the example above, $dest and $msg will be destroyed when the hook
finishes eval'ing.  Hooks also run in the ::IRC namespace.  All of
XiRCON's commands sit there too.  That's why [args] doesn't need
::IRC:: in front of it.

ok, I'm feeling lazy again.  L8r.
