[Gridflow-cvs] [svn] commit: r3452 - in /trunk: base/flow_objects.rb deprecated/listappend.pd deprecated/listlength.pd deprecated/listprepend.pd deprecated/messageappend.pd deprecated/messageprepend.pd

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Apr 4 02:18:15 EDT 2008


Author: matju
Date: Fri Apr  4 02:18:14 2008
New Revision: 3452

Log:
[listlength] [listprepend] [listappend] [messageprepend] [messageappend] are deprecated and remade as pd abstractions depending on pd 0.39 or 0.40

Added:
    trunk/deprecated/listappend.pd
    trunk/deprecated/listlength.pd
    trunk/deprecated/listprepend.pd
    trunk/deprecated/messageappend.pd
    trunk/deprecated/messageprepend.pd
Modified:
    trunk/base/flow_objects.rb

Modified: trunk/base/flow_objects.rb
==============================================================================
--- trunk/base/flow_objects.rb (original)
+++ trunk/base/flow_objects.rb Fri Apr  4 02:18:14 2008
@@ -298,16 +298,11 @@
 	class Demux < self; install "demux", 2, 0; end
 }
 
-# can't be replaced by 0.39-based abstractions because the following can handle nested lists (to some extent)
 FObject.subclass("listmake",2,1) {
 	def initialize(*a) @a=a end
 	def _0_list(*a) @a=a; _0_bang end
 	def _1_list(*a) @a=a end
 	def _0_bang; send_out 0, :list, *@a end
-}
-FObject.subclass("listlength",1,1) {
-	def initialize() super end
-	def _0_list(*a) send_out 0, a.length end
 }
 FObject.subclass("listelement",2,1) {
 	def initialize(i=0) super; @i=i.to_i end
@@ -323,37 +318,9 @@
 	def _2_float(n) @n=n.to_i end
 	def _0_list(*a) send_out 0, :list, *a[@i, at n] end
 }
-FObject.subclass("listprepend",2,1) {
-	def initialize(*b) super; @b=b end
-	def _0_list(*a) a[0,0]=@b; send_out 0, :list, *a end
-	def _1_list(*b) @b=b end
-}
-FObject.subclass("listappend",2,1) {
-	def initialize(*b) super; @b=b end
-	def _0_list(*a) a[a.length,0]=@b; send_out 0, :list, *a end
-	def _1_list(*b) @b=b end
-}
 FObject.subclass("listreverse",1,1) {
 	def initialize() super end
 	def _0_list(*a) send_out 0,:list,*a.reverse end
-}
-FObject.subclass("messageprepend",2,1) {
-	def initialize(*b) super; @b=b end
-	def _0_(*a) a[0,0]=@b; send_out 0, *a end
-	def _1_list(*b) @b=b end
-	def method_missing(sym,*a)
-		(m = /(_\d_)(.*)/.match sym.to_s) or return super
-		_0_ m[2].intern, *a
-	end
-}
-FObject.subclass("messageappend",2,1) {
-	def initialize(*b) super; @b=b end
-	def _0_(*a) a[a.length,0]=@b; send_out 0, *a end
-	def _1_list(*b) @b=b end
-	def method_missing(sym,*a)
-		(m = /(_\d_)(.*)/.match sym.to_s) or return super
-		_0_ m[2].intern, *a
-	end
 }
 
 FObject.subclass("route2",1,1) {
@@ -403,13 +370,19 @@
 
 FObject.subclass("printargs",1,0) {
   def initialize(*args)
+    super
     @aaargh = args
+  end
+  def initialize2()
     @clock = Clock.new self
     @clock.delay 0
   end
   def call
     post "ruby=%s", @aaargh.inspect
     post "  pd=%s",    args.inspect
+  end
+  def method_missing(*a)
+    post "message: %s", *a.inspect
   end
 }
 



More information about the Gridflow-cvs mailing list