Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class library: deprecate String:inform #2427

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions HelpSource/Classes/String.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,7 @@ code::
::

method::inform
Posts the string.
code::
"Do not press this button again".inform;
::
Deprecated. Alias for link::#-postln::.

subsection:: Interpreting strings as code

Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/Common/Audio/Splay.sc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SplayZ {
if (levelComp) { level = level * n.reciprocal.sqrt };

"SplayZ is deprecated, because its geometry is wrong.
Please convert to SplayAz.".inform;
Please convert to SplayAz.".postln;

^Mix(PanAz.ar(
numChans,
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/Common/Audio/SystemSynthDefs.sc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SystemSynthDefs {

// clean up any written synthdefs starting with "temp__"
var path = SynthDef.synthDefDir ++ tempNamePrefix ++ "*";
"Cleaning up temp synthdefs...".inform;
"Cleaning up temp synthdefs...".postln;
pathMatch(path).do { |file| File.delete(file) };

// add system synth defs
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/Common/Collections/Collection.sc
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ Collection {
};

if (outliers > 0) {
("histogram :" + outliers + "out of (histogram) range values in collection.").inform;
("histogram :" + outliers + "out of (histogram) range values in collection.").postln;
};

^freqs;
Expand Down
1 change: 0 additions & 1 deletion SCClassLibrary/Common/Collections/String.sc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ String[char] : RawArray {
}
error { "ERROR: ".post; this.postln; }
warn { "WARNING: ".post; this.postln }
inform { ^this.postln }
++ { arg anObject; ^this prCat: anObject.asString; }
+ { arg anObject; ^this prCat: " " prCat: anObject.asString; }
catArgs { arg ... items; ^this.catList(items) }
Expand Down
1 change: 0 additions & 1 deletion SCClassLibrary/Common/Control/Bus.sc
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ Bus {
if(rate == \audio, {
^In.ar(index + offset, numChannels)
}, {
//"Bus converting control to audio rate".inform;
^K2A.ar( In.kr(index + offset, numChannels) )
})
}
Expand Down
18 changes: 9 additions & 9 deletions SCClassLibrary/Common/Control/Server.sc
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ Server {

boot { | startAliveThread=true, recover=false, onFailure |

if (statusWatcher.serverRunning) { "server already running".inform; ^this };
if (statusWatcher.serverBooting) { "server already booting".inform; ^this };
if (statusWatcher.serverRunning) { "server already running".postln; ^this };
if (statusWatcher.serverBooting) { "server already booting".postln; ^this };

statusWatcher.serverBooting = true;

Expand All @@ -638,7 +638,7 @@ Server {
statusWatcher.doWhenBooted({
statusWatcher.serverBooting = false;
if (recChannels.notNil and: (recChannels != options.numOutputBusChannels)) {
"Resetting recChannels to %".format(options.numOutputBusChannels).inform
"Resetting recChannels to %".format(options.numOutputBusChannels).postln
};
recChannels = options.numOutputBusChannels;

Expand All @@ -658,7 +658,7 @@ Server {
}, onFailure: onFailure ? false);

if(remoteControlled.not) {
"You will have to manually boot remote server.".inform;
"You will have to manually boot remote server.".postln;
} {
this.bootServerApp;
}
Expand All @@ -667,7 +667,7 @@ Server {
bootServerApp {
var f;
if (inProcess) {
"booting internal".inform;
"booting internal".postln;
this.bootInProcess;
pid = thisProcess.pid;
} {
Expand All @@ -694,12 +694,12 @@ Server {
};
fork{ f.(10) }
};
("booting " ++ addr.port.asString).inform;
("booting " ++ addr.port.asString).postln;
};
}

reboot { arg func; // func is evaluated when server is off
if (isLocal.not) { "can't reboot a remote server".inform; ^this };
if (isLocal.not) { "can't reboot a remote server".postln; ^this };
if(statusWatcher.serverRunning) {
Routine.run {
this.quit;
Expand Down Expand Up @@ -751,9 +751,9 @@ Server {

if (inProcess, {
this.quitInProcess;
"quit done\n".inform;
"quit done\n".postln;
},{
"/quit sent\n".inform;
"/quit sent\n".postln;
});

pid = nil;
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/Common/Core/Kernel.sc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Process {
Class.initClassTree(AppClock); // AppClock first in case of error
time = this.class.elapsedTime;
Class.initClassTree(Object);
("Class tree inited in" + (this.class.elapsedTime - time).round(0.01) + "seconds").inform;
("Class tree inited in" + (this.class.elapsedTime - time).round(0.01) + "seconds").postln;
Class.classesInited = nil;

topEnvironment = Environment.new;
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/Common/Files/File.sc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Pipe : UnixFILE {
}, clock: AppClock);
cancel = {
r.stop();
("Closed:" + command).inform;
("Closed:" + command).postln;
closePipe.value();
CmdPeriod.remove(cancel);
};
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/Common/GUI/PlusGUI/Control/ServerPlusGUI.sc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
if(this.isLocal or: { this.inProcess }) {
if(dumping, stopDump, startDump)
} {
"cannot dump a remote server's messages".inform
"cannot dump a remote server's messages".postln
}
}
{char === $m } { if(this.volume.isMuted) { this.unmute } { this.mute } }
Expand Down
4 changes: 2 additions & 2 deletions SCClassLibrary/Common/GUI/PlusGUI/Core/HistoryGui.sc
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,15 @@ HistoryGui : JITGui {
var line;
if (object.lines.isNil) { "no history lines yet.".postln; ^this };
line = object.lines[index];
if (line.isNil) { "history: no line found!".inform; ^this };
if (line.isNil) { "history: no line found!".postln; ^this };
textV.string_(line[2]);
}

postDoc { |index|
var line;
if (object.lines.isNil) { "no history lines yet.".postln; ^this };
line = object.lines[index];
if (line.isNil) { "history: no line found!".inform; ^this };
if (line.isNil) { "history: no line found!".postln; ^this };
this.setDocStr(line[2]);
doc.front;
try { this.alignDoc };
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/Common/Quarks/Quark.sc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Quark {
git = Git(localPath);
git.pull();
git.checkout("master");
("Quark '%' updated to version: % tag: % refspec: %".format(name, this.version, this.git.tag, this.refspec)).inform;
("Quark '%' updated to version: % tag: % refspec: %".format(name, this.version, this.git.tag, this.refspec)).postln;
}, {
("Quark" + name + "was not installed using git, cannot update.").warn;
});
Expand Down
6 changes: 3 additions & 3 deletions SCClassLibrary/Common/Quarks/Quarks.sc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Quarks {
(quark.name
+ "reports an incompatibility with this SuperCollider version"
+ "or with other already installed quarks."
).inform;
).postln;
false
},
prev = this.installed.detect({ |q| q.name == quark.name });
Expand All @@ -195,7 +195,7 @@ Quarks {
^false
});

"Installing %".format(quark.name).inform;
"Installing %".format(quark.name).postln;

quark.checkout();
if(quark.isCompatible().not, {
Expand All @@ -209,7 +209,7 @@ Quarks {
});
};
this.link(quark.localPath);
(quark.name + "installed").inform;
(quark.name + "installed").postln;
this.clearCache();
^true
}
Expand Down
6 changes: 3 additions & 3 deletions SCClassLibrary/Common/Streams/History.sc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ History { // adc 2006, Birmingham; rewrite 2007.
path = path ?? { saveFolder ++ "history_" ++ this.class.timeStamp ++ ".scd" };
file = File(path.standardizePath, "w");
file.write(lines2write.asCompileString);
inform("History written to:" + path);
postln("History written to:" + path);
file.close;
}

Expand Down Expand Up @@ -397,7 +397,7 @@ History { // adc 2006, Birmingham; rewrite 2007.
if (logFile.isOpen) {
logFile.write(format("// History, as it was on %.\n\n",
timeString) ++ "[\n" /*]*/ );
"// History.logFile opened.".inform;
"// History.logFile opened.".postln;
} {
"// History: could not open logFile!".warn;
};
Expand All @@ -419,7 +419,7 @@ History { // adc 2006, Birmingham; rewrite 2007.
*endLog {
// close file
try { logFile.write( /*[*/ "];") };
try { logFile.close; "// History.logFile closed.".inform; };
try { logFile.close; "// History.logFile closed.".postln; };
}

*showLogFile { Document.open(this.logPath) }
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/DefaultLibrary/Main.sc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Main : Process {
}
};
if(didWarnOverwrite) {
inform("Intentional overwrites must be put in a 'SystemOverwrites' subfolder.")
postln("Intentional overwrites must be put in a 'SystemOverwrites' subfolder.")
};

("\n\n*** Welcome to SuperCollider %. ***".format(Main.version)
Expand Down
4 changes: 2 additions & 2 deletions SCClassLibrary/JITLib/Patterns/extRoutine.sc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
while { t.roundUp(tolerance) < by }
{
event = this.next(inevent.copy);
if(event.isNil) { ("end of stream. Time left:" + (by - t)).inform; ^t - by };
if(event.isNil) { ("end of stream. Time left:" + (by - t)).postln; ^t - by };

event = event.copy.put(\freq, \rest);
event.play;
delta = event.delta;
if(delta.isNil) { ("end of stream. Time left:" + (by - t)).inform; ^t - by };
if(delta.isNil) { ("end of stream. Time left:" + (by - t)).postln; ^t - by };

t = t + delta;

Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/JITLib/ProxySpace/NodeProxy.sc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ NodeProxy : BusPlug {
if(server.serverRunning) { container.loadToBundle(bundle, server) } { loaded = false; };
this.prepareOtherObjects(bundle, index, oldBus.notNil and: { oldBus !== bus });
} {
format("failed to add % to node proxy: %", obj, this).inform;
format("failed to add % to node proxy: %", obj, this).postln;
^this
};

Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/JITLib/ProxySpace/extStoreOn.sc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@

space = ProxySpace.findSpace(this);
spaceCS = try { space.asCode } {
inform("// <could not find a space for proxy: %!>".format(this.asCompileString));
postln("// <could not find a space for proxy: %!>".format(this.asCompileString));
""
};

Expand Down
6 changes: 6 additions & 0 deletions SCClassLibrary/deprecated/3.9/deprecated-3.9.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+ String {
inform {
this.deprecated(thisMethod);
^this.postln
}
}