Search code examples
smalltalkpharo

How to create a new source file in Pharo?


I downloaded the Pharo launcher and stable appimage for version 9.0 in Windows 10. Now I want to try a hello world program, but I can't see a "create new file" option.

How do I create a new source file?


Solution

  • Update: adding examples and adding information

    You should understand the original philosophy of the Smalltalk.

    The whole OS was supposed to be written in Smalltalk and the GUI was to call the Smalltalk libraries in the OS.

    The whole IDE was meant to be an enclosed world. It did not evolve that way so now Smalltalk has to communicate with the outside world somehow, but it kept its ways when creating new code.

    For your hello world application you need to, either use Transcript (Transcript show: 'Hello World') for short, testing code or as Leandro has written create a 'HelloWorld' package.

    An example of such package:

    Object subclass: #Greeting
        instanceVariableNames: ''
        classVariableNames: ''
        package: 'HelloWorld'
    

    You can find nice tutorials already created so please take advantage of those. I'll direct you to one, which contains answer to your question:

    Pharo quick start by Richard Kenneth