- Scope
- dynamic
- static
 
- lifetime
- calling conventions
- pass by reference
- pass by value
 
- OOP things
- Inheritance
- Method Resolution
- VMT
 
- Tail-Call Recursion
- Haskell
- Recursion
- Polymorphism
- Higher-Order Functions
- Types
- Typeclasses
- Laziness
- Calling a method is known as sending a message
Order of Operations is not kept unless you use parenthesis
3+2*2 "returns 10"5 factorial.|foo|
foo := 3*4+2
foo factorial.Indexes start at 1
|myarray|
myarray := #(4 2 1).
myarray.
anotherarray := {4. 3. 2. 1.}
concatarray := myarray , anotherarray."This is a comment"
|mystr|
mystr := 'here is some text'.
mystr at: 4. "equivalent to mystr[4] in python"
mystr at: 4 put: $q "puts q at index 4"mystr reverse.Every object supports the class method
4 class. "return SmallInteger"@ method
(4 @ 9) class.to: method
5 to: 20 "returns interval 5 through 20 inclusive"4 class.
'whatever' reverse.
9 negated.Binary messages always use symbols (ex: + , @)
3 + 4
'hello', 'world'
9 @ 23 max: 9.
'hello' at: 2.
'hello' endsWith: lo.
'hello there' copyFrom: 2 to: 4. "returns ell"
mystr at: 3 put: $q.- Parentheses
- Unary
- Binary
- Keyword
- (from left to right)
Right-click on the leftmost pane in the System Browser to create a new class
Object subclass: #Person
	instanceVariables: 'name age'
	classVariableNames: ''
	package: 'Proglang'Age getter:
- ^represents return
age
	"answers the age of this person"
	| temporary variable names |
	^ageAge setter:
age: newAge
	age := newAge.Name getter:
name
	^name.
isTooOld method:
- We're using the age getter method instead of the age instance variable, but either one would work
isTooOld:
	^self age < 65another implementation that checks size of a Person's name:
isTooOld:
	^(self age > 65) and: [self name size > 20].
|myperson|
myperson := Person new.
myperson age: 99; name; 'bob'.
myperson.|test|
test := [Transcript show: 'Hello World']
test value.{ 'hello'. 'noodle'. 'spatula'. } do: [ :word | 
	Transcript show: 'The word of the day is ', word; cr.
]5 to: 20 do: [:num | Transcript show: num]|myarray|
myarray := { 'hello'. 'noodle'. 'spatula'. }
|mycoll|
mycoll := OrderedCollection new.
mycoll add: 3.
mycoll add: 9.
mycoll add: 23.
"alternative"
mycoll := OrderedCollection newFrom: #(3 9 23).3 = 9 ifTrue: [ Transcript show: 'yes it is'; cr. ]
	  ifFalse: [Transcript show: 'no it isn't'; cr. ].- an instance method printString defines how an object should be represented as a string
#proglang-f19