Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11397
Modified Files: Tag: devel_0_39 desire.tk Log Message: class History: translated remaining bits of Ruby to Tcl
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.227 retrieving revision 1.1.2.228 diff -C2 -d -r1.1.2.227 -r1.1.2.228 *** desire.tk 11 Jun 2006 18:12:48 -0000 1.1.2.227 --- desire.tk 11 Jun 2006 22:08:39 -0000 1.1.2.228 *************** *** 5,9 **** # DesireData # Copyright (c) 2004 by Mathieu Bouchard ! # Copyright (c) 2005 by Mathieu Bouchard and Chun Lee # This software has no license yet # And is not covered by the license on the rest of PureData. --- 5,9 ---- # DesireData # Copyright (c) 2004 by Mathieu Bouchard ! # Copyright (c) 2005,2006 by Mathieu Bouchard and Chun Lee # This software has no license yet # And is not covered by the license on the rest of PureData. *************** *** 179,191 **** # runs the restore procedure for the last item in the root undo_queue. def History undo {} { ! begin { ! set backup $@undo ! set @undo $@redo ! set @redo {} ! perform backup.pop ! } ensure { ! set @redo $@undo ! set @undo $backup ! } }
--- 179,189 ---- # runs the restore procedure for the last item in the root undo_queue. def History undo {} { ! set backup $@undo ! set @undo $@redo ! set @redo {} ! set err [catch {perform backup.pop}] ! set @redo $@undo ! set @undo $backup ! if {$err} [error "error during undo"] }
*************** *** 201,209 **** def History perform {mess} { $self atomically { ! if Array===$mess { ! foreach x [lreverse $mess] {perform $x} ! } { ! $mess call ! } } } --- 199,203 ---- def History perform {mess} { $self atomically { ! foreach x [lreverse $mess] {$mess call} } } *************** *** 212,222 **** set ubackup @undo; set @undo {} set rbackup @redo; set @redo {} ! begin { ! uplevel 1 $code ! } ensure { ! lappend backup_undo $@undo_queue ! set @undo_queue $ubackup ! set @redo_queue $rbackup ! } }
--- 206,214 ---- set ubackup @undo; set @undo {} set rbackup @redo; set @redo {} ! set err [catch {uplevel 1 $code}] ! lappend backup_undo $@undo_queue ! set @undo_queue $ubackup ! set @redo_queue $rbackup ! if {$err} [error "error during undo"] }