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

[sc-dev] SF.net SVN: supercollider: [7370] trunk/build/SCClassLibrary/Common/ Collections/String.sc



Revision: 7370
          http://svn.sourceforge.net/supercollider/?rev=7370&view=rev
Author:   cruxxial
Date:     2008-02-23 07:33:38 -0800 (Sat, 23 Feb 2008)

Log Message:
-----------
adding: withoutTrailingSlash
and reformatting the die ERROR output

Modified Paths:
--------------
    trunk/build/SCClassLibrary/Common/Collections/String.sc

Modified: trunk/build/SCClassLibrary/Common/Collections/String.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Collections/String.sc	2008-02-23 15:31:59 UTC (rev 7369)
+++ trunk/build/SCClassLibrary/Common/Collections/String.sc	2008-02-23 15:33:38 UTC (rev 7370)
@@ -61,8 +61,10 @@
 	matchRegexp { arg string, start = 0, end; _String_Regexp ^this.primitiveFailed }
 
 	die { arg ... culprits;
-		("\n\nFATAL ERROR: " ++ this).postln;
-		culprits.do({ arg c; if(c.isString,{c.postln},{c.dump}) });
+		if(culprits.notEmpty,{
+			("\n\nFATAL ERROR: ").postln;
+			culprits.do({ arg c; if(c.isString,{c.postln},{c.dump}) });
+		});
 		Error(this).throw; 
 	}
 	error { "ERROR:\n".post; this.postln; }
@@ -240,6 +242,14 @@
 			^this
 		})
 	}
+	withoutTrailingSlash {
+		if(this.last == $/,{
+			^this.copyRange(0,this.size-2)
+		},{
+			^this
+		})
+	}
+			
 	absolutePath{
 		var first;
 		first = this[0];
@@ -379,4 +389,4 @@
 		if( speech.initialized.not, { speech.init });
 		speech.channels[ channel ].speak( this, force );
 	}
-}
\ No newline at end of file
+}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.