[PD-cvs] pd/src objective.tcl,1.1.2.3,1.1.2.4

Mathieu Bouchard matju at users.sourceforge.net
Wed Nov 2 12:49:07 CET 2005


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

Modified Files:
      Tag: devel_0_39
	objective.tcl 
Log Message:
new_as: error for duplicate object.
def,def*: error for class not found.
def,def*: "?" can be part of an @ var name


Index: objective.tcl
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/objective.tcl,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** objective.tcl	31 Oct 2005 12:47:11 -0000	1.1.2.3
--- objective.tcl	2 Nov 2005 11:49:05 -0000	1.1.2.4
***************
*** 30,33 ****
--- 30,34 ----
  	proc ${self}_new_as {self args} "
  		global _
+ 		if {[info exists _(\$self:_class)]} {error \"object '\\$self' already exists\" }
  		set _(\$self:_class) $self
  		eval [concat [list \$self init] \$args]
***************
*** 43,53 ****
  
  proc def {class selector args body} {
  	proc ${class}_$selector "self $args" \
! 		"global _; [regsub -all @(\\w+) $body _(\$self:\\1)]"
  }
  
  proc def* {class selector args body} {
  	proc* ${class}_$selector "self $args" \
! 		"global _; [regsub -all @(\\w+) $body _(\$self:\\1)]"
  }
  
--- 44,58 ----
  
  proc def {class selector args body} {
+ 	global _
+ 	if {![info exists _($class:_class)]} {error "unknown class '$class'"}
  	proc ${class}_$selector "self $args" \
! 		"global _; [regsub -all @(\[\\w\\?\]+) $body _(\$self:\\1)]"
  }
  
  proc def* {class selector args body} {
+ 	global _
+ 	if {![info exists _($class:_class)]} {error "unknown class '$class'"}
  	proc* ${class}_$selector "self $args" \
! 		"global _; [regsub -all @(\[\\w\\?\]+) $body _(\$self:\\1)]"
  }
  





More information about the Pd-cvs mailing list