The classic Smalltalk Workspace has the possibility of saving and loading script files explicitly. GTPlayground does not have these options because we think they are not needed. Indeed, in most cases, all you want is to play with code and be able to retrieve it later without worrying of where you stored it. To this end, the playground saves transparently all scripts and GTSpotter helps you find them afterwards.
However, on the Pharo mailing list, Phil described recently an interesting use case that goes like this:
Indeed, this type of use cases is what can lead an IDE developer to create an save/load feature in a workspace. But, there exists another way. Suppose you want to you want to edit a demo-scripts/get-pharo-picture.st
script. You first search for the demo-scripts
folder and find the script.
Triggering the default action, opens an inspector which already gives you a built in playground with all navigation options it entails. And because we have a dedicated file reference in hand, we can just save the contents in place.
And if you want a more persistent navigator for your files, you can also inspect the containing folder and manipulate the scripts exclusively in the inspector.
The Glamorous Toolkit comes with very few classes of operations but the combinations that spawn from these cover a surprising amount of use cases. In our case, all of a sudden the inspector is turned into a full blown playground with no extra effort. At the same time the global Playground is freed by the quaint constraint of saving and loading files.