Version 0 of TeaTime

Updated 2005-11-18 20:59:38

Zarutian 18. november 2005:

TeaTime is the underlying object system of Croquet. (Or that is as much as I gather)

see http://www.opencroquet.org/Croquet_Technologies/architecture.html for more details.

And the code below was inspired by the TeaTime concept:

 # below code by Zarutian is hereby in the public domain
 proc thingy {name} { proc $name args "namespace eval $name \$args" }
 proc trackedThingy {name} {
   proc $name args [string map [list @name $name] {
     namespace eval @name lappend __history $args
     namespace eval @name set this @name
     namespace eval @name $args
   }]
   $name proc undo {} {
     variable __history
     variable this
     set local_this $this
     set local_history $__history
     namespace delete [namespace current]
     $local_this set __history $local_history
     foreach invocation [lrange $local_history 0 end-1] {
       eval [concat $local_this $invocation]
     }
   }
 }
 # the above code hasnt been tested as of 20:57 UTC