'From Cuis 5.0 [latest update: #4127] on 1 May 2020 at 4:39:11 pm'!

!TerseGuideHelp class methodsFor: 'pages' stamp: 'KenD 5/1/2020 16:49:17'!
methodCall
	"Method Calls"
	^
'"
	Method calls:
		- unary methods are messages with no arguments	
		- binary methods
		- keyword methods are messages with selectors including colons
 
	standard categories/protocols:
		- initialize-release    (methods called for new instance)
		- accessing             (get/set methods)
		- testing               (boolean tests - is)
		- comparing             (boolean tests with parameter
		- displaying            (gui related methods)
		- printing              (methods for printing)
		- updating              (receive notification of changes)
		- private               (methods private to class)
		- instance-creation     (class methods for creating instance)
"
| x |
x _ 2 sqrt.									"unary message"
x _ 2 raisedTo: 10.						"keyword message"
x _ 194 * 9.								"binary message"
Transcript show: (194 * 9) printString; newLine.	"combination (chaining)"
x _ 2 perform: #sqrt.					"indirect method invocation"
Transcript									"cascading ; send multiple messages to first receiver"
   show: ''hello '' ;
   show: ''world'' ;
   newLine.
"Without semicolon cascading"
x := RectangleLikeMorph new.
x color: Color yellow.
x openInWorld.
"Using semicolon cascade -- we don''t need the variable, x"
RectangleLikeMorph new
	color: Color yellow; 
	openInWorld.
3 + 2; * 100.							"result=300. Sends message to same receiver (3)"
"Parentheses are used for grouping.  In many cases parentheses can be replaced by ::"
3 squared ; + 5.  " 8 -- semicolon -> cascade to _original_ receiver (3)"
(3 squared) + 5. " 14 -- use parens to group"
3 squared :: + 5. " 14 -- same but double-colon -> cascade to _result_ of expression at left (9)"
"The double colon is useful in eliding parens from complex keyword expressions"
(3 squared between: 2 squared and: 4 squared) ifTrue: [ #Great ] ifFalse: [ #Oops ].
3 squared between: 2 squared and: 4 squared :: ifTrue: [ #Great ] ifFalse: [ #Oops ].

'! !
