how to exit at once

i wanna exit at once after running?but it doesnt work like this?

function setup()
    close()
end

That works for me. As soon as i run it, the program comes into view then exits ton he editor.