This patch for tcl8.0p2 makes the following code possible:

set ($this,m) x
puts $(this,m) ;# instead of $className::($this,m)

thus making the new stooop 3.x much less verbose when accessing class
data members, and much faster too!

Since this new feature does not break anything in the Tcl core, I
think this would be a worthwhile feature to integrate into the core
(maybe in 8.1 as it is too late for 8.0).

IF YOU ARE USING STOOOP, I ENCOURAGE YOU TO WRITE TO JOHN OUSTERHOUT
ABOUT THIS. The more requests he gets, the more chance there is that
this will make it into the core. And furthermore, John is a very nice
guy and always responds to emails.

Moreover, it would add some consistency to the core:

namespace a {
    variable {}
}
set a::(x) 0
puts $a::(x)  ;# works with current tcl version
namespace a {
    set (x) 0
    puts $(x) ;# should work as line above
}

So, here are the patches (one for Tcl 8.0, one for 8.1. the changed
files are from the generic/ tcl source sub-directory):

### Tcl 8.0 ##########################################################

*** tclCompile.c.orig	Sat Jan 10 20:44:27 1998
--- tclCompile.c	Sat Jan 10 20:48:01 1998
***************
*** 3121,3127 ****
                  c = *src;
              }
  	}
! 	if (src == name) {
  	    /*
  	     * A '$' by itself, not a name reference. Push a "$" string.
  	     */
--- 3121,3127 ----
                  c = *src;
              }
  	}
!   	if ((src == name) && (*src != '(')) {
  	    /*
  	     * A '$' by itself, not a name reference. Push a "$" string.
  	     */
*** tclParse.c.orig	Sat Jan 10 20:44:40 1998
--- tclParse.c	Sat Jan 10 20:48:01 1998
***************
*** 813,819 ****
  		string++;
  	    }
  	}
! 	if (string == name1) {
  	    if (termPtr != 0) {
  		*termPtr = string;
  	    }
--- 813,819 ----
  		string++;
  	    }
  	}
!         if ((string == name1) && (*string != '(')) {
  	    if (termPtr != 0) {
  		*termPtr = string;
  	    }

######################################################################



### Tcl 8.1 ##########################################################

*** tclParse.c.orig	Sat Jan 24 21:25:39 1998
--- tclParse.c	Sat Jan 24 21:26:13 1998
***************
*** 1551,1557 ****
  	    break;
  	}
  	tokenPtr->size = src - tokenPtr->start;
! 	if (tokenPtr->size == 0) {
  	    goto justADollarSign;
  	}
  	parsePtr->numTokens++;
--- 1551,1557 ----
  	    break;
  	}
  	tokenPtr->size = src - tokenPtr->start;
! 	if ((tokenPtr->size == 0) && !((src != end) && (*src == '('))) {
  	    goto justADollarSign;
  	}
  	parsePtr->numTokens++;

######################################################################
