[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] [commit?] many patterns storeArgs



done.

lately since I've been trying to get a new sc thing to work and encountering so many bugs I've developed a kind of rhythm.  every bug I do a unit test and then expand it to find any larger case where it might have happened.  and i ask myself how could I have detected and fixed this before it reached the annoyance stage.  (I had a pattern fail to save)

its kind of annoying because it generates huge numbers of bugs and anomalies, but it has a satisfaction to it as well.

there must be a finite number of bugs.
but for every feature added you increase the universe of possible bugs.


var exceptions;
exceptions = [PatternProxy,PbindProxy,Pbind,PFork,Pprob,Pflow,PlazyEnvirN,ListPattern,Pmono,Pfx,Pbindf,Pslide,Pwrand,Pseq,Pwalk,Pdfsm];

Pattern.allSubclasses.reject(IsIn(exceptions)).do({ |class|
var constructor,argNames,decoys,new;
var storeArgs,asCompileString, recompile;

"".postln;
// num of args in constructor, 
constructor = class.class.findMethod('new');
if(constructor.isNil,{
"no constructor".debug(class)
},{
argNames = constructor.argNames;
decoys = argNames.copyRange(1,argNames.size-1).as(Array);
decoys.debug(class);
if(constructor.argNames.notNil,{
//yep, we just fed it its own argNames
new = class.performList('new',decoys);
});
// do storeArgs
storeArgs = new.storeArgs;
if((storeArgs == decoys),{
"TRUE!".debug;
},{
storeArgs.debug("failed storeArgs");
})
// numbers should come back the same
// do asCompileString
// recompile
//
// should be the same
})
})



On Sat, Feb 23, 2008 at 11:07 PM, Julian Rohrhuber <rohrhuber@xxxxxxxxxxxxxx> wrote:
ok, this is good - please go ahead.

At 21:34 Uhr +0100 23.02.2008, felix wrote:
>other classes in common have actual bugs that i found.
>
>
>
>Index: <http://Pdef.sc>Pdef.sc
>===================================================================
>--- <http://Pdef.sc>Pdef.sc    (revision 7335)
>+++ <http://Pdef.sc>Pdef.sc    (working copy)
>@@ -792,7 +792,7 @@
>       *new { arg dict, which, repeats=inf, default;
>               ^super.newCopyArgs(dict, which, repeats, default);
>       }
>-
>+      storeArgs { ^[dict,which,repeats,default ] }
>       embedInStream { arg inval;
>               var keyStream, key;
>               keyStream = which.asStream;
>Index: <http://Pxfade.sc>Pxfade.sc
>===================================================================
>--- <http://Pxfade.sc>Pxfade.sc        (revision 7335)
>+++ <http://Pxfade.sc>Pxfade.sc        (working copy)
>@@ -28,6 +28,7 @@
>                               }
>                       }
>       }
>+      storeArgs { ^[ pattern, fadeTime, holdTime, tolerance ] }
>  }
>
>  PfadeOut : PfadeIn {
>Index: <http://Psym.sc>Psym.sc
>===================================================================
>--- <http://Psym.sc>Psym.sc    (revision 7335)
>+++ <http://Psym.sc>Psym.sc    (working copy)
>@@ -4,6 +4,7 @@
>       *new { arg pattern, dict;
>               ^super.new(pattern).dict_(dict)
>       }
>+      storeArgs { ^[pattern,dict] }
>
>       lookupClass { ^Pdef }
>       lookUp { arg key;
>@@ -53,7 +54,7 @@
>       *new { arg pattern, dict, quant, dur, tolerance = 0.001;
>               ^super.newCopyArgs(pattern, dict, quant, dur, tolerance)
>       }
>-
>+      storeArgs { ^[ pattern, dict, quant, dur, tolerance ] }
>       embedInStream { arg inval;
>               var str, outval, pat, quantVal, quantStr, durVal, durStr;
>               str = pattern.asStream;
>
>
>_______________________________________________
>Sc-devel mailing list
>Sc-devel@xxxxxxxxxxxxxxx
>http://lists.create.ucsb.edu/mailman/listinfo/sc-devel


--





.
_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel



--
chris sattinger
skype: crucialfelix
aim: crucialfelix