[squeak-dev] The Trunk: Help-Squeak-TerseGuide-pre.6.mcz

commits at source.squeak.org commits at source.squeak.org
Wed May 25 08:31:52 UTC 2016


Patrick Rein uploaded a new version of Help-Squeak-TerseGuide to project The Trunk:
http://source.squeak.org/trunk/Help-Squeak-TerseGuide-pre.6.mcz

==================== Summary ====================

Name: Help-Squeak-TerseGuide-pre.6
Author: pre
Time: 25 May 2016, 10:31:44.454733 am
UUID: d0c651c0-c1cb-46c8-982a-ea2ec9f08c60
Ancestors: Help-Squeak-TerseGuide-kfr.5

Added a section on exception handling

=============== Diff against Help-Squeak-TerseGuide-kfr.5 ===============

Item was added:
+ ----- Method: TerseGuideHelp class>>exceptionHandling (in category 'pages') -----
+ exceptionHandling
+ 
+ 	^HelpTopic
+ 		title: 'Exception Handling' 
+ 		contents:
+ 
+ '"************************************************************************
+  * Exceptions:																		*
+  ************************************************************************"
+ | x |
+ x := Object new.
+ x error: ''Throwing an error''.
+ 
+ NotFound signal.								"simply throwing a specific exception"
+ NotFound signal: ''Throwing with a message''.	"throwing an exception with a custom text"
+ 
+ x := [ 5 / 0 ]							"simple exception handler"
+ 		on: ZeroDivide do: [ 10 ]. 			
+ x := [ 5 / 0 ]							"processing the exception in an exception handler" 
+ 		on: Error do: [:e | Transcript showln: e printString ]. 
+ x := [ 5 / 0 ]							"different exception handlers for the same block"
+ 		on: ZeroDivide do: [ 10 ] 
+ 		on: MessageNotUnderstood do: [ 20 ]. 
+ x := [ 5 / 0 ]							"one exception handler for two different exceptions"
+ 		on: ZeroDivide , ArithmeticError do: [ 10 ]. 
+ 
+ 
+ '!

Item was changed:
  ----- Method: TerseGuideHelp class>>pages (in category 'accessing') -----
  pages
  
  	^ #( introduction transcript assignment constants boolean arithmetic
+ 		bitwise conversion block exceptionHandling methodCall conditionalStatement
- 		bitwise conversion block methodCall conditionalStatement
  		iterationStatement character symbol string array orderedCollection
  		sortedCollection bag set interval association dictionary internalStream
  		fileStream date time point rectangle pen dynamic metaclass debugging
  		misc )!



More information about the Squeak-dev mailing list