Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12123
Modified Files: Tag: devel_0_39 objective.tcl Log Message: fixed the @foo$bar macro expansion
Index: objective.tcl =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/objective.tcl,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -C2 -d -r1.1.2.12 -r1.1.2.13 *** objective.tcl 19 Jun 2006 05:58:31 -0000 1.1.2.12 --- objective.tcl 21 Jun 2006 06:05:59 -0000 1.1.2.13 *************** *** 37,47 **** #proc def* {class selector args body} {$class def* $selector $args $body}
proc def {self selector args body} { global _; if {![info exists _($self:_class)]} {error "unknown class '$self'"} ! proc ${self}_$selector "self $args" "global _; [regsub -all @([\$\w\?]+) $body _($self:\1)]" } proc def* {self selector args body} { global _; if {![info exists _($self:_class)]} {error "unknown class '$self'"} ! proc* ${self}_$selector "self $args" "global _; [regsub -all @([\$\w\?]+) $body _($self:\1)]" }
--- 37,51 ---- #proc def* {class selector args body} {$class def* $selector $args $body}
+ proc expand_macros {body} { + return [regsub -all @(\$?[\w\?]+) $body _($self:\1)] + } + proc def {self selector args body} { global _; if {![info exists _($self:_class)]} {error "unknown class '$self'"} ! proc ${self}_$selector "self $args" "global _; [expand_macros $body]" } proc def* {self selector args body} { global _; if {![info exists _($self:_class)]} {error "unknown class '$self'"} ! proc* ${self}_$selector "self $args" "global _; [expand_macros $body]" }