[PD-cvs] pd/src objective.tcl, 1.1.2.6, 1.1.2.7 desire.tk, 1.1.2.156, 1.1.2.157

Mathieu Bouchard matju at users.sourceforge.net
Sun Apr 16 08:28:12 CEST 2006


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27465

Modified Files:
      Tag: devel_0_39
	objective.tcl desire.tk 
Log Message:
history -> History
and introducing a class called Class


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.156
retrieving revision 1.1.2.157
diff -C2 -d -r1.1.2.156 -r1.1.2.157
*** desire.tk	16 Apr 2006 06:18:04 -0000	1.1.2.156
--- desire.tk	16 Apr 2006 06:28:10 -0000	1.1.2.157
***************
*** 108,114 ****
  # adapted from matju's MetaRuby (UndoQueue.rb)
  
! class_new history
  
! def history init {} {
  	set @undo {}
  	set @redo {}
--- 108,114 ----
  # adapted from matju's MetaRuby (UndoQueue.rb)
  
! class_new History
  
! def History init {} {
  	set @undo {}
  	set @redo {}
***************
*** 118,122 ****
  # of undo may be kept.
  # keep in mind that undo information is kept hierarchically.
! def history add {message} {
  	lappend @undo $message
  	set @redo {}
--- 118,122 ----
  # of undo may be kept.
  # keep in mind that undo information is kept hierarchically.
! def History add {message} {
  	lappend @undo $message
  	set @redo {}
***************
*** 124,128 ****
  
  # runs the restore procedure for the last item in the root undo_queue.
! def history undo {} {
  	begin {
  		set backup $@undo
--- 124,128 ----
  
  # runs the restore procedure for the last item in the root undo_queue.
! def History undo {} {
  	begin {
  		set backup $@undo
***************
*** 136,140 ****
  }
  
! def history redo {} {
  	set backup $@redo
  	set @redo {}
--- 136,140 ----
  }
  
! def History redo {} {
  	set backup $@redo
  	set @redo {}
***************
*** 145,149 ****
  # this traverses a tree and runs all the restore operations.
  #!@#$ could I use #flatten! now ?
! def history perform {mess} {
    $self atomically {
  	if Array===$mess {
--- 145,149 ----
  # this traverses a tree and runs all the restore operations.
  #!@#$ could I use #flatten! now ?
! def History perform {mess} {
    $self atomically {
  	if Array===$mess {
***************
*** 155,159 ****
  }
  
! def history atomically {code} {
  	set ubackup @undo; set @undo {}
  	set rbackup @redo; set @redo {}
--- 155,159 ----
  }
  
! def History atomically {code} {
  	set ubackup @undo; set @undo {}
  	set rbackup @redo; set @redo {}
***************
*** 174,178 ****
  #end
  
! set history [history_new]
  
  #-----------------------------------------------------------------------------------#
--- 174,178 ----
  #end
  
! set history [History_new]
  
  #-----------------------------------------------------------------------------------#

Index: objective.tcl
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/objective.tcl,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** objective.tcl	16 Apr 2006 06:18:04 -0000	1.1.2.6
--- objective.tcl	16 Apr 2006 06:28:10 -0000	1.1.2.7
***************
*** 1,2 ****
--- 1,3 ----
+ # $Id$
  #----------------------------------------------------------------#
  # OBJECTIVE TCL
***************
*** 14,19 ****
  if {$tcl_version < 8.5} {source pre8.5.tcl}
  set nextid 0
! set _(class:_class) class
! set _(class:_super) {Thing}
  
  proc proc* {name args body} {
--- 15,20 ----
  if {$tcl_version < 8.5} {source pre8.5.tcl}
  set nextid 0
! set _(Class:_class) Class
! set _(Class:_super) {Thing}
  
  proc proc* {name args body} {
***************
*** 45,50 ****
  proc class_new {self {super {Thing}}} {
  	global _
! 	set _($self:_class) class
  	set _($self:_super) $super
  	proc ${self}_new {args} "
  		global nextid _
--- 46,53 ----
  proc class_new {self {super {Thing}}} {
  	global _
! 	set _($self:_class) Class
  	set _($self:_super) $super
+ 	set _($self:subclasses) {}
+ 	foreach sup $super {lappend _($sup:subclasses) $self}
  	proc ${self}_new {args} "
  		global nextid _
***************
*** 114,117 ****
--- 117,121 ----
  
  class_new Class
+ def Class subclasses {} {return $@subclasses}
  
  #-----------------------------------------------------------------------------------#





More information about the Pd-cvs mailing list