The use of procedures named setup
and go
in NetLogo, and the pattern in which you typically attach them to buttons, is purely a convention. You can make as many procedures as you want, call them whatever you want, and have those procedures call each other in any way you want.
So for example, if you want to call setup
from within your go
procedure, go right ahead.
If your setup
procedure calls clear-all
, though, that might not be a smart thing to do. In that case you'd want to split the setup procedure into two separate procedures, where one of the procedures contains only the part you want to reuse. Something like:
to setup
clear-all
...
setup-environment
...
end
to setup-environment
...
end
to go
...
setup-environment
...
end