Boatloads of non-inlined functions
Closed this issue · 2 comments
This isn't a functionality problem, but it's untidy and will also slow the code down.
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/EventStream/EventStream.sc'
line 170 char 28:
var key = [ this, name ];
this.do(f);
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/EventStream/EventStream.sc'
line 172 char 29:
dict.at( key ) !? { |oldf| this.stopDoing( oldf ) };
dict.put( key, f)
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/EventStream/EventStream.sc'
line 175 char 28:
var key = [ this, name ];
dict.at( key ) !? { |oldf| this.stopDoing( oldf ) };
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/EventStream/EventStream.sc'
line 176 char 29:
dict.at( key ) !? { |oldf| this.stopDoing( oldf ) };
dict.put( key , nil)
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/EventStream/EventStream.sc'
line 252 char 55:
var bus = Bus.control(server, initVal.asArray.size);
var f = { |x| bus.setn( x.asArray ) };
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Monads/DoNotation.sc'
line 151 char 62:
var restOfSemicolons = semicolons[1..].asLazy;
var default = Tuple2(None(), restOfSemicolons).success;
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Monads/DoNotation.sc'
line 211 char 96:
var rest = this.processDoBlock(string[(posLastSemicolonToBeProcessed+1)..]);
rest.collect{ |rest|
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Monads/DoNotation.sc'
line 262 char 45:
var nextnpar = numpar -1;
//"removing p".postln;
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Monads/DoNotation.sc'
line 284 char 23:
}.sequence;
var ends = if(preends.isKindOf(Array)){ preends.success } {preends};
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Monads/DoNotation.sc'
line 327 char 22:
};
var start = orderedDoBloks[0][0];
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Monads/DoNotation.sc'
line 370 char 53:
var end = string[(start+2)..].find("\n");
if(end.isNil) {
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Monads/DoNotation.sc'
line 385 char 53:
var end = string[(start+2)..].find("*/");
if(end.isNil) {
-----------------------------------
ERROR: Class extension for nonexistent class 'MKtlElement'
In file:'/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/EventStream/NetworkDescriptionAdditions.sc'
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Additions/TypeClasses-Object.sc'
line 143 char 38:
var end = this.size-2;
this[0..end].injectr(this.last.collect{ |x| [x] }, { |mstate,m|
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Additions/TypeClasses-Object.sc'
line 160 char 38:
var end = this.size-2;
this[0..end].injectr(this.last.collect{ Unit }, { |mstate,m|
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
in file '/home/dlm/.local/share/SuperCollider/Extensions/FPLib/Classes/Additions/TypeClasses-Object.sc'
line 177 char 38:
var end = this.size-2;
this[0..end].injectr( f.( this.last ).collect{ |z| [z] }, { |ys,v|
-----------------------------------
I guess most of those warning can be removed, although it will make the code even harder to understand. Functional programming uses a lot of... functions. :-)
Had a look, a lot of those warnings are for arguments of anonymous functions, so those certainly can't be removed. Looking at the remaining ones, declaring the variable earlier in the code introduces the possibility of more bugs since you can then mutate the variable outside the anonymous function in between the declaration and the next subsequent use. I looked at the cases where this happened and only in two places were they performance sensitive. I've changed those, and left the remaining unaltered.