Interpreter auto quit


#1

Hello all,

It’s a simple question :
How can I quit programmatically SC lang ?

this.quit
like a return(0) from the Main ?
Do I need SIGTERM ?


#2

0.exit
will do it. It returns:

-> 0
main: waiting for input thread to join...
main: quitting...
server 'localhost' disconnected shared memory interface
/quit sent

cleaning up OSC
Interpreter has quit. [Exit code: 0]

#3

Yes, thank you!

All my old good habits vanished :frowning:


#4

Is there also a way to reboot the interpreter from code ? (in order to start a new project without making all the cleanup)


#5

The IDE’s language menu has two relevant commands:

  • Reboot interpreter. This quits the currently running sclang process and launches a new one.

  • Recompile class library. This resets the interpreter’s state, but within the same sclang process.

I don’t know of any sclang command to reboot the interpreter.

For the other, there is thisProcess.recompile.

Probably recompiling the class library is enough to “start a new project without making all the cleanup.”

hjh