From 9ea4e9fc1b4775a0e6b1c387a2a0965686c1c20e Mon Sep 17 00:00:00 2001 From: mescalinum Date: Fri, 14 Oct 2011 21:32:49 +0000 Subject: reorder tcl land into namespaces and streamline and standardize syntax svn path=/trunk/externals/loaders/tclpd/; revision=15600 --- examples/list_change.tcl | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'examples/list_change.tcl') diff --git a/examples/list_change.tcl b/examples/list_change.tcl index 2c70937..26190e4 100644 --- a/examples/list_change.tcl +++ b/examples/list_change.tcl @@ -1,31 +1,32 @@ -package require Tclpd 0.2.1 -package require TclpdLib 0.17 +package require Tclpd 0.2.3 +package require TclpdLib 0.19 -pd::class list_change { - constructor { - # add second inlet (first created by default) - pd::add_inlet $self list +proc+ list_change::constructor {self args} { + # add second inlet (first created by default) + pd::add_inlet $self list - # add outlet - pd::add_outlet $self list + # add outlet + pd::add_outlet $self list - set @curlist {} - } - - 0_list { - # HOT inlet - if {$args != $@curlist} { - set @curlist $args - pd::outlet $self 0 list $@curlist - } - } + set @curlist {} +} - 0_bang { +proc+ list_change::0_list {self args} { + # HOT inlet + if {$args != $@curlist} { + set @curlist $args pd::outlet $self 0 list $@curlist } +} - 1_list { - # COLD inlet - set @curlist $args - } +proc+ list_change::0_bang {self} { + if {$@curlist == {}} return + pd::outlet $self 0 list $@curlist } + +proc+ list_change::1_list {self args} { + # COLD inlet + set @curlist $args +} + +pd::class list_change -- cgit v1.2.1