Monday, February 21, 2011

The Pharo programming environment

Smalltalk and modern graphical interfaces were developed together
Let us see all  the main tools in Pharo:
  • The Browser is the central development tool.we can use it to create,define, and organize your classes and methods. Using it you can also navigate through all the library classes.In this all the classes and methods are contained in the image.
  •  The Message Names tool is used to look,all the methods with a particular selectorwith a substring.
  •  The Method Finder tool is also same like msg name tool
  •  The Monticello Browser is the starting point for loading code from, and saving code in, Monticello packages.
  • The Process Browser provides a view on all of the processes (threads) executing in Smalltalk.
  • The Test Runner lets you run and debug SUnit tests,
  • The Transcript is a window on the Transcript output stream, which is useful for writing log messages .
  • The Workspace is a window into which you can type input. It can be used for typing Smalltalk
    expressions and executing them as do it s. 
  • The Debugger has an obvious role, when compared to other programming lang..Smalltalk you can program in the debugger. The debugger is
    not launched from a menu; it is normally entered by running a failing test,
    by typing CMD–. to interrupt a running process, or by inserting a self halt
    expression in code. 

Friday, February 18, 2011

Sending messages and restarting a Pharo session

  •  Open a workspace. Type in the following text:
                  "BouncingAtomsMorph new openInWorld"

Now action-click. A menu should appear. Select do it (d) .
  • A window containing a large number of bouncing atoms should open inthe top left of the Pharo image.
  • You have just evaluated your first Smalltalk expression! You just sent the message new to the BouncingAtomsMorph class, resulting in a new BouncingAtomsMorph
  • The BouncingAtomsMorph class decided what to do with the new message, that is, it looked up its methods for handling new message and reacted appropriately.
  • Similarly the BouncingAtomsMorph instance looked up its method for
    responding to openInWorld and took appropriate action.


Saving, quitting and restarting a Pharo:
  • Select World . Save as . . . , enter the name “myPharo”, and click on the OKbutton. Now select World . Save and quit .
  • Now if you go to the location where the original image and changesfiles were, you will find two new files called “myPharo.image” and “myPharo.changes” that represent the working state of the Pharo image at the moment before you told Pharo to Save and quit . 
  • If you wish, you can mov these two files anywhere that you like on your disk, but if you do so you may
    (depending on your operating system) need to also move, copy or link to the virtual machine and the sources file





  • When you start Pharo for the first time, the Pharo virtual machine loadsthe image file that you provide. This file contains a snapshot of a largenumber of objects, including a vast amount of pre-existing code and a largenumber of programming tools (all of which are objects). 
  • As you work with Pharo, you will send messages to these objects, you will create new objects,and some of these objects will die and their memory will be reclaimed (i.e.,garbage-collected).
  • When you quit Pharo, you will normally save a snapshot that contains allof your objects. If you save normally, you will overwrite your old image filewith the new snapshot.
  • Alternatively, you may save the image under a newname, as we just did.In addition to the .image file, there is also a .changes file. This file containsa log of all the changes to the source code that you have made using the standard tools.











Wednesday, February 9, 2011

HELLO WORLD PROGRAM

Now let us do some simple programs in pharo..
first we shall start with hello world program

As soon as pharo open it wil luk lik dis...




Nw type yhe following "Transcript show:'Hello World' " in the work space window.. nw see the result in transcript window.




Friday, February 4, 2011

How to work in PHARO

  • Pharo is available as a free download from http://pharo-project.org. There are
    three parts that you will need to download, consisting of four files.
                                      Pharo virtual machine.(pharo.exe)
                                      Pharo shared sources(squeakv.sources)
                                      Pharo.image
                                      Pharo.changes
  • After downloading drag n drop pharo.image file on the pharo icon..        

What are Squeak and Pharo?

  • Squeak is a modern, open-source, highly portable, fast, full-featured Smalltalk implementation Based on original Smalltalk-80 code                                      
  •  Pharo is a lean and clean fork of Squeak
                           www.pharo-project.org




                                                                                                   

History of smalltalk