OTcl Change Log

# Change History since version 0.96 (otcl)

### otcl-1.14 Released Sat Oct 29 2011

(Major change is to update for tcl-8.5 changes, contributed from Amir Habibi (habibi@uci.edu)) TCL 8.5.3 has several fundamental internal and API changes that render OTCL's use of its low level data structures and API syntactically and semnatically incompatible. The major changes are:

- Variables are kept in a new internal hashtable type named VarInHash. Majority of hashtable API functions do not take this into consideration and lead to segmentation faults. Unfortunately majority of the potential API functions are defined as static in original TCL code under generic/tclVar.c and we have to redefine them in OTCL code.
  CallFrame.varTablePtr doesn't any longer refer to a string based hashtable. The new type is TclVarHashtable that encapsulates a VarInHash type hashtable (table) along with a namespace (nsPtr). It doesn't need to be initialized as TCL engin will allocate it if a local variable is to be defined.
  - Commands are parsed into object-based and string-based functions in Tcl_CmdInfo and clientData is not any longer guaranteed to be iof (Proc *) type.

  Changes made in otcl1-13 to make it compatible with TCL 8.5.3 and hopefully later versions are as follows: (Referenced line numbers are with regards to the new version)

  - 0059-0064: Modified to reflect the change in the CallFrame. it also defines TCL_VERSION_8_5_OR_HIGHER to simplify changes.
  - 0069-0083: Define few Tcl_xxx macros to make the changes as clean as possible. These macros are defined for pre and post TCL 8.5.3
  - 0587-0597: AddMethod is supposed to keep a copy of a Tcl_CmdInfo data structure after TCL engine has parsed the tcl code. ocd input argument is addded to the prototype to deal with object-based ClientData or the (Proc *) of the tcl procedure. For internal Object and Class objects only string-based information is needed by OTCL. Based on this change, calls to AddMethod in the following lines are modified: 1418-1423, 1845-1849, 1945, 1954
  - 0609-0612: Apparently TCL calls the delete function on the Tcl_CmdInfo and we don't need to call it again otherwise glibc panics b/c of double free call on the same pointer. (I didn't dig into this one and my fix may cause a memory leak)
  - 0732-0737: ListKeys is used for dumping keys in all hashtables and since the variables has is no longer a string hash, this functions is slightly modified to reflect this change. Since TCL doesn't make VarHash related functions available to public, we can't automatically recognize a VarInHash type and I resorted to adding a new input argument, isVarHash, to explicitly pass the flag to this function. Based on this change, calls to Listkeys in the following lines are modified: 1372, 1388, 1804
  - 0784: Modified to reflect object-based versus string-based functions use of clientData and objClientData in Tcl_CmdInfo respectively.
  - 0920: VarTablePtr doesn't need to be initialized in TCL 8.5.3 and the call to Tcl_InitHashTable for older versions is added to Tcl_VarHashInitilize macro.
  - 0949-0952: Modified to initialize additional fields in CallFrame.
  - 1004: Modified to cover the cases where varTablePtr remains null during the lifetime of the object.
  - 1008-1015: Modified to reflect changes in varTablePtr
  - 1021-1035: This block of code is no longer needed as in TCL 8.5.3 hPtr is removed Var structure and instead VarInHash encapsualtes Var and Tcl_HashEntry. (This may need further investigation !!!)
  - 1036-137: Modified to cover the cases where varTablePtr remains null during the lifetime of the object.
  - 1069-1071: Modified to use macros that deal with different ways of initialization of varTablePtr in TCL 8.5.3 and older versions.
  - 1208-1210: Modified to use macros that deal with different ways of initialization of varTablePtr in TCL 8.5.3 and older versions.
  - 1211: Modified to clarify the assignment. This is not related to changes for TCL 8.5.3

  ### otcl-1.13 Released Sat Mar 10 2007

- Refresh packages, Sun OS compilation patch

### otcl-1.12 Released Sat Sep 24 2006

- Refresh packages

### otcl-1.11 Released Wed Oct 19 21:04:00 PDT 2005

- One change from otcl-1.10-- reverting the removal of X libs and headers from the configure files, to support building on Cygwin.

### otcl-1.10 Released Sun Oct 2 15:00:00 PDT 2005

- [tomh] Mon Sep 26 21:58:00 PDT 2005
Bumping up version numbers: configure.in.TclCL, configure.in.tcl, configure.in.tk

- [tomh] Sun Sep 25 22:22:00 PDT 2005
Remove configure.in.Tcl because it is in the way for HFS+ file systems. Slight mod to the Tcl include path for Fedora Core 4

- [tomh] Tue Sep 6 21:53:00 PDT 2005
Patch for Mac OS X (XCode 2.1). Contributed by Francesco Gringoli.

- [tomh] Wed Aug 31 18:54:00 PDT 2005
patches for Debian pre-installed Tcl/Tk, and for building with -Wall and -Werror on gcc-4.0.1 (mainly autoconf fixes). Contributed by Georg Wittenburg and Mathieu Lacage, respectively.

- [xuanc] Tue Feb 10 21:07:17 PST 2004
Change the default versions in conf/configure.in.{tcl,tk,otcl,TclCL}

- [johnh] Tue Feb 10 17:16:59 PST 2004
Change configure support for Fedora's /usr/share/tcl8.3.

### otcl-1.9 Released Wed Jan 19 11:55:01 PST 2005

### otcl-1.0a9[OLD]/otcl-1.8[NEW] Released Fri Jan 9 12:04:50 PST 2004

- [xuanc] Tue Jul 29 11:16:14 PDT 2003
Changes to make otcl build with tcl/tk 8.4.4.

- Define macros CONST84 and CONST84_RETURN in otcl.h
- Change char* to CONST84 char* (or CONST84_RETRUN char * if it is a function return) in otcl.c
- test hangs for lib/test.tcl (autoload), see comments in lib/test.tcl

### otcl-1.0a8[OLD]/otcl-1.7[NEW] Released on Wed Apr 10 14:12:36 PDT 2002

- [lloydlim] Thu Aug 30 00:55:33 PDT 2001
Changes to makefile.vc:

- Now it will actually work with a standard Visual C++ installation.
- Added flexibility in determining location of Tcl/Tk directories.
- Updated for Tcl/Tk 8.3.3.
- Updated for new Tcl/Tk static build support. See Tcl patch #456759 and Tk patch #456761.
- Eliminated warning messages.

- [johnh] Tue Jun 26 11:49:20 PDT 2001
Updated README.html with more details about finding tclInt.h.

### otcl-1.0a7[OLD]/otcl-1.6[NEW] Released on Wed May 30 10:07:21 PDT 2001

- [johnh] Tue Dec 12 10:36:34 PST 2000
Updated config.guess to autoconf's current one.

### otcl-1.0a6[OLD]/otcl-1.5[NEW] Released on Mon Oct 16 21:01:42 PDT 2000

- [yaxu] Mon Oct 16 21:01:42 PDT 2000
  Otcl 1.0a6 released
- [haoboy] Thu Oct 5 10:59:59 PDT 2000
  Patch for instvar in global scope by Orion Hodson.

### otcl-1.0a5[OLD]/otcl-1.4[NEW] Released on Tue Jan 18 16:06:34 PST 2000

- [haoboy] Mon Jul 12 12:59:09 PDT 1999
  The strategy for making otcl work with a range of tcl versions is to pull out all incompatibilities into this section. The main-line code should basicly follow the current Tcl interfaces. Where those interfaces don't work with older versions, replace the interface with compat_Tcl_ and add work-around code here.
  Guidelines on porting otcl to newer versions of TCL:
  - Data structure changes: define a macro to wrap around the data structure names for different versions, and define access macros to provide a uniform interface to different fields. If there are drastically different data structure changes that require control logic changes, see below.
  - Control logic changes: define a macro for the new initialization or processing and set it to empty for the older versions.

- [haoboy] Thu May 27 19:17:51 PDT 1999
  Corrected compiling directives so that it works with tcl/tk 8.1.1.

- [haoboy] Thu May 13 16:46:14 PDT 1999
  Bug report, NOT fixed: OTcl does not allow any variables with name 'p1' and 'p2' in the global name space, however, all other names seem to be fine.

      yym:src/otcl(140): otclsh
      % Class B
      B
      % B p1
      couldn't find result of alloc
      % B p2
      couldn't find result of alloc
      % B p3
      p3
      % B p0
      p0

- [YP] Mon Jan 4 5:00:00 PST 1999
  BUG REPORT(NOT FIXED): validation test of autoload fails to pass under Linux and FreeBSD. Here is the upper part of the stack (Linux, which results in a segmentation fault):

          #0  0x4011378d in __libc_free (mem=0xbffed744) at malloc.c:2861
          #1  0x804a84b in AutoLoaderDP (cd=0xbffed744) at otcl.c:492
          #2  0x804aa35 in RemoveMethod (methods=0x80fc514, nm=0x8100920 "1", cd=0x80fc4c0) at otcl.c:571
          #3  0x804c9e0 in OTclCInstProcMethod (cd=0x80fc4c0, in=0x8099f90, argc=7, argv=0xbfff00f4) at otcl.c:1769
          #4  0x804a674 in OTclDispatch (cd=0x80fc4c0, in=0x8099f90, argc=5, argv=0xbfff0144) at otcl.c:421
          #5  0x804e523 in TclInvokeStringCommand ()

  This does not appear to be critical for ns, because it does not uses autoloading.

### otcl-1.0a4[OLD]/otcl1.3[NEW] Released on Mon Feb 22 17:50:15 PST 1999

- [haoboy] Thu May 13 16:46:14 PDT 1999
  Added the following patch to not let OTcl crash when it's not able to create a variable:

      --- otcl.c~     1998/09/07 18:53:43
      +++ otcl.c      1999/05/13 23:30:13
      @@ -1,6 +1,6 @@
       /* -*- Mode: c++ -*-
        *
      - *  $Id: CHANGES.html,v 1.52 2009/12/30 20:08:12 tom_henderson Exp $
      + *  $Id: CHANGES.html,v 1.52 2009/12/30 20:08:12 tom_henderson Exp $
        *
        *  Copyright 1993 Massachusetts Institute of Technology
        *
      @@ -1522,7 +1522,8 @@
         if (result != TCL_OK) return result;

         obj = OTclGetObject(in, argv[4]);
      -  if (obj == 0) OTclErrMsg(in, "couldn't find result of alloc",
      TCL_STATIC);
      +  if (obj == 0)
      +         return OTclErrMsg(in, "couldn't find result of alloc",
      TCL_STATIC);
         (void)RemoveInstance(obj, obj->cl);
         AddInstance(obj, cl);

- [johnh] Thu Jul 23 10:26:54 PDT 1998
  tcl-7.6 support was broken; fixes inspired by Lloyd Wood should restore it.

### otcl-1.0a3[OLD]/otcl-1.2[NEW] Released on Tue July 7 13:10:00 PST 1998

- [johnh] Tue Jun 30 09:49:53 PDT 1998
  classinstvars support turned on by default (and the ifdef's removed).
- [johnh] Tue Jun 9 13:42:06 PDT 1998
  - Added support code for delayed binding (in tclcl). Currently this code is only turned on if you do --enable-tclcl-classinstvars when configuring.
  - re-autoconf'ed
  - condesed some of the tcl7/tcl8 compatibility code with #define ObjVarTablePtr
- [johnh] Thu May 21 21:49:34 PDT 1998
  - Fixed a case in OTclDispatch error handling where clobbered arguments (in the buggy callee) lead to a segfault.
- [johnh] Mon May 18 16:46:51 PDT 1998
  - install targets were backwards.

### otcl-1.0a2[OLD]/otcl-1.1[NEW] Fri Jan 23 11:54:21 PST 1998

- [SM] Mon Dec 22 12:59:21 PST 1997
  - Fixed exactly the same bug as last rev. Only difference is it occurred in another place.
- [SM] Sun Dec 21 22:11:14 PST 1997
  - Fixed a bug in OTclDispatch that caused core dump when an error conditrion occured evaluating an instproc with more than 8 args.
- [TLT] Wed Dec 17 15:22:49 GMT-8:00 1997
  - Added additional stack trace info when there is an error in OTclDispatch. This gives "resolved_class procname ..." in addition to the "_o? procname" line.

### otcl-1.0a1[OLD]/otcl-1.0[NEW] Mon Dec 15 20:13:00 PST 1997

Non-publicized test release.

- [SM] Mon Dec 15 20:13:00 PST 1997
  - Converted configure to use mash/ns configure infratructure.
  - Cleaned up this change history.
  - Fixed things up for test release of 1.0a1 (need to clear with Wetherall, though he gave a preliminary "okay").
- [KVa] Mon Dec 8 09:51:16 PST 1997
  - Linux uses libdl.a (not libdld.a).
    Fix configure, configure.in.
- [TLT] Sat Nov 15 18:29:41 GMT-8:00 1997
  - changed makefile to compile functions with static library
  - changed otcl procedures to use a single "::otcl" namespace. This removes the need for the previous kludge in otcl, whereby a tcl procedure is created using TclProjCmd, and then deleted from the interpreter so that only otcl knows about it. For the deletion to work, we have to use a hack which increment the reference count before deleting it. Besides the high chance that this hack will not work with future versions of tcl, the deletion also invalidates the byte compilation and as a result each proc is byte-compiled twice.

    In AddMethod(), procedures are now created as `::otcl::pn` where n is a running number. The deleteproc of the created procedure (OTclDeleteProc) now uses Tcl_FindCommand() to delete the procedure from tcl if it still exists.

    Some simple experiments show that the impact on speed and memory is small.

- [EA] Tue Oct 28 11:50:08 PST 1997
  - Fixed problem in ListProcArgs since tcl8 now appends instvars and arguments to ame list, but adds a flag.
- [TLT] Sat Oct 25 19:49:19 PDT 1997
  - fix problem where some variables are freed multiple times. The variable flags is a bitmap now, so that (vp->flags != VAR_UNDEFINED) is not correct.
- [TLT] Mon Oct 6 14:46:51 PDT 1997
  - Merged in patch for Tcl/Tk8.0 from http://catarina.usc.edu/~haoboy/otcl-0.96.patch.
  - (Bug fix) PrimitiveCDestory attempts to delete the instances hash table after its contents have been free in PrimitiveODestory. Created new function PrimitiveODestoryNoFree that does not free the memory itself.
  - (Bug fix) `MakeProc` creates a new procedure, then calls `Tcl_DeleteCommand` with a null deleteproc to create a Tcl-invisible proc. With 8.0, `Tcl_DeleteCommand` frees the `cmdPtr` structure also, which renders the "invisible proc" unusable. Added code to prevent the deletion of `cmdPtr` and free it up when the procedure is destoryed.
    Check that this kludge works when we move to a new version!
- [TLT] Thu Aug 7 13:26:18 PDT 1997
  Checkin of makefile.vc for win32. otcl.lib and tclsh.exe now compiles under WinNT 4.0. It should run/compile on win95 as well (not tested yet).
- [TLT] July 97 Merged in changes from Steve Mccanne to fix the bug that causes tcl to remove and free some instvars twice.