...... hr:aLv rgamn Environment Programming Live a Pharo: close. stream temcontents. stream tem: wr / (work := stream close. stream nextPutAll: stream h ae hr oeBrowser Code Pharo Panes 5 The options). available see to text selected image, any contextual on the the menu (open in menus and directly combinations evaluated key simple and using inspected be can Code All executing. Pharo: is in program implemented are your tools while Pharo code your and objects environment. a development is integrated Pharo an with comes Pharo / (work := stream workingDirectory. disk FileSystem := work • • • • • • package); di a the to belong a protocol with this starts of name methods protocol a When navigation. ease to The . the of ods the package; The The more. much much, and itself compiler the inspectors; and workspace, a debugger, a refactorings; with browser code a Packages *Fuel protocols packages classes iepormigenvironment programming live rtclgop ehd htbln othe to belong that methods groups protocol aesostecasheacyo h selected the of hierarchy class the shows pane ls side class aegop h ehd fteslce class selected the of methods the groups pane ’ ’ aesosaltepcae ftesystem. the of packages the all shows pane foo.txt foo.txt ’ el World Hello ie n Streams and Files Classes ’ ’ readStream. ) writeStream. ) hcbxalw o etn h meth- the getting for allows checkbox ’ Code pane . Protocols o a oiyyour modify can you : ff rn akg ( package erent

Methods ’ el World Hello Fuel e.g., ’ * ,

...... with etms eipeetdi ehdwoenm starts name whose method a in implemented be must test A oadacaso dtacas dttepooe ! proposed the edit class, a de edit expression following or The class a add To h eodln elrstevariable the declares line second The method The ls of class hr a ipednmclytpdojc model: object dynamically-typed simple a has Pharo model powerful and uniform simple, A assert: testing Unit methods. instance as Method lookup dynamic same returns the method follow a methods default By the receiver. in up the looked of always class are They virtual. and public are Methods Methods method the class of content the is text following Counter new message Counter the sending by created is instance initialValue De • • fi OrderedCollectionTest nee >> Integer >> Counter #Counter subclass: Object method. actions; The special trigger and clickable are icons The igaclass a ning test Counter ’foo’). includes: (collection ’foo’. assert: add: self collection := added | added | ef>0iTu:[ ef*(ef-1 factorial]. 1) - (self * self [^ ifTrue: 1]. 0 [^ > ifTrue: receiver." self 0 the = of self factorial the "Answer ’MyCounter’ package: ’’ classVariableNames: initialValue’ ’count instanceVariableNames: methods orecode source Object on =0. := count initialize. super factorial xet revalue. true a expects initialize >> n nacasta neisfrom inherits that class a in and initialize . . . aelsstemtoso h eetdprotocol; selected the of methods the lists pane nietepackage the inside factorial initialize I de t aesostesuc oeo h selected the of code source the shows pane de fi e w ntnevariables instance two nes fi e nclass in ned satmtclyivkdwe new a when invoked automatically is fi sa is e h class the nes testAdd >> notation MyCounter I nteger. added oidct htthe that indicate to initialize new TestCase Counter h message The . otecasi.e., class the to . self count sasub- a as . Class . nthe in and

...... iia Syntax Minimal books More (http://book.seaside.st) Seaside Tutorial, in Development TinyBlog Web Pharo, Dynamic in Web Methods a Numerical Pharo: Enterprise Perspective, Pharo, into Deep Example, By Pharo are be Pharo can in Concepts which minutes. syntax few expressive a in and learned simple a has The environment. language programming own its and language purpose an both is Pharo thisContext books Pharo PharoBooks Association Consortium Topics Contributors Blog Questions hosting Code Sites Web Main • • true ninvtv,oe-oreSmalltalk-inspired open-source innovative, An vrtigi nojc:btos oos ras numbers, . arrays, . methods. colors, classes, buttons, object: an is Everything ml ubro ue,n exceptions! no rules, of number small A agaeadsse o ieprogramming live for system and language http://pharoweekly.wordpress.com , http://topics.pharo.org super false self nil http://discord.gg/Sj2rhxn http://stephane.ducasse.free.fr/FreeBooks http://association.pharo.org r vial t http://books.pharo.org at: available are http://consortium.pharo.org http://pharo.org/about http://smalltalkhub.com http://www.pharo.org h eevro h urn message current the of receiver the objects boolean the unde the h urn ehdo lc activation block or method current the h eevrbtfracsigoverridden accessing methods for but receiver the object-oriented i eevdwrsonly words reserved Six Everything! fi e object ned , dynamically-typed eyconsistent very general- : ...... hnw edamsaet nojc (the object an to message a send we When ihasbet eb n complements. and verb, a subject, a with A A n rmr yblcaatr from characters symbol more or one new size. 1) 2 #(4 new. Array Java Keyword and Binary, Unary, Messages: of Types Three aColor.setRGB(0.2,0.3,0) 0 at: d b: 0.3 g: 0.2 r: aColor Pharo languages, natural mimics syntax Message method object. the an and answers executed, and selected is method responding Sending Message

comment . II #symbol a oarguments. no has ^ ) 3 anArray ae nyoeagmn n snmdby named is and argument one only takes #lit ’ string expr expr expr exp2 ’ .u(1,"Chocolate"); d.put("1", . ; > ] " ’ variables ae eunase result method a a from return/answer - caret cascade message - semicolon separator statement - period assignment temporary two of declaration array ex- 2 pressions from built array dynamic symbol the #abc with array literal ihayltrlarguments literal any with annotation method parameter a with block code fl hexa) binary, (decimal, twelve string unique characters of aigpitnumbers oating-point n h number the and + , - , * , = receiver , < , > ... , ,tecor- the ), 123

...... World’ ’ A h string The The hyaetebssfrcnrlsrcue:cniinl loops. & conditionals structures: control for basis the are They mes- last the of value the is value cascade message whole The sends example third The block. a executes line second The 2. by: 10 to: 3 name. message the in inserted ’ 4 + 3 edtemessage the Send demand. on executed is that code containing objects are Blocks Blocks cascade. the of cas- message message the of ( receiver instead the cade return To 3). (here sent sage 1 add: to sent are 3 add: and 2 add: Here expression. same the Using Object Same the to Messages Muliple Sending Cascade: 3 * 4 + 2 with messages binary and Messages not 3) * 4 + 2 and: 1 between: (15 right. to Parentheses Precedence Message containing to:by: ’ Hello Pharo x|x+2]vle 7 value: ] 2 + x | :x [ ewr message keyword 2 = 2 new OrderedCollection + not ’ ]. ’Help’ signal: Error [ ifTrue: 3. add: 2; add: 1; add: ; ’ , esg ssn oteobject the to sent is message 2. allButFirst: ’ acsae utpemsae r ett h eutof result the to sent are messages multiple cascade) (a World h uesu rule The . to 14! not 18, gives and left-to-right reads + 3 steargument. the as ’Hello’ 3 , and > iharguments with , 5 i.e., ’ , unary 7 * and ,

h olcin,send collection), the r sent are ifTrue: a aeoeo oeagmnsta are that arguments more or one take can ’ 7 > el World Hello eevstemessage the receives 9 ff

onto fmteaia precedence mathematical of notion no binary . r oecpin prtr r just are operators exception: no ers 3t:1 y 2) by: 10 to: (3 9 ’ aro ; fi s,then rst, rie fe d:1 omessages so 1, add: after arrives oteboolean the to 10 ’ > ewr,and keyword, ’ and

’ eevr collection. a receiver: s 2 between:and: hsrtrsa interval an returns this ; false 3 yourself with true , 4 fi cma with (comma) al rmleft from nally sargument. as (computed stelast the as ssent, is .

...... e e d:4 d:4;yourself new ; Dictionary 4 add: 4; yourself add: ; new 2 add: 4; add: 2) 6 new: (Array put: 3 at: 1} . 2 6 . put: {4 3 at: copy 1) 2 #(4 3 at: 1) 2 #(4 ""}; "B", ={"A", names [] String put:value at:i aCol 1. at start Collections i++){ i<11; i=1; for(int #( := names | names | | :i [ do: 11 to: 1 (condition) if condition the via it result, passing element, each for once message the Send true from omnConstructs Common ae o ec ytmotpit ae); name System.out.print( | :each [ do: names odto hlTu:wie(odto){action(); { (condition) while whileTrue: ] condition [ t aput: #a at: rncitso:each, show: Transcript rncitso:i;c ytmotpitni;} System.out.println(i); ] cr ; i show: Transcript fre cin]{ato(;} action(); { } anotherAction(); { else ] anotherAction [ ifFalse: ] action [ ifTrue: ) $! World’ #(’Hello cin nteAto nteAto(;} anotherAction(); ] anotherAction action. [ 2 = 2 h lc seeue n necpini signaled. is exception an and executed is block the , ] e show: Transcript | :e [ do: el World! Hello ’ A ihaboka ruet eas h ola is boolean the Because argument. as block a with ) ’ Alpha ’ ’ B ’ ’ C ’ ’ .fr tignm ae { ) names : name String for( ). yourself ; do: Clat:i aCol Loops/ sprinted. is ’ Conditionals oa ra.Ti xctsteblock the executes This array. an to Collections , ’ eseeetat element sets ytmotpit"";} System.out.print(","); ] I terators cesseeeta and i at element accesses >

’ Alpha i e Dictionary(#a- a aSet(4) 2) #(4 6) 2 #(4 6) 2 #(4 1 to aaee.A a As parameter. value ’ ) .