smalltalk Flashcards

1
Q

what is Smalltalk?

A
  • an object-oriented language
  • no standard syntax for declaring methods
  • first language packaged with its own IDE
  • evolved from Simula 671 (for simulations)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

model of computation

A
  • all computation done by sending messages to objects
  • variables must be declared before use, but no type is given
  • everything is an object (no type needed)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

objects in Smalltalk include:

A
  • variables
  • classes
  • numbers
  • code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Smalltalk general syntax:

A

//idk why it keeps reverting back to this. this is incorrect. object/message/argument { [argument] }

s push: 10
s size
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Smalltalk class definitions

A
  • can contain instance and class definitions

* common to all instances of the class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Smalltalk messages

A

written to the right of the recipient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Smalltalk class instances

A
  • instance definitions are specific to each object

* instance variables are private to that object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Smalltalk class methods

A

primarily used to create new instances

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

unary

A

a message without an arg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

keyword

A
  • a message with an arg

* end in a colon and may be made into a sequence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

expressions

A
  • always evaluated from left to right
  • a sequence of expressions is separated by .
  • a value is returned using ^
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

precedence

A

unary, binary, keyword messages, ^

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

misc syntax

A
"..." is a comment
/.../ is a string
$a is the character a
#a is the symbol a (don't evaluate)
default value for all variables in Smalltalk is nil
How well did you know this?
1
Not at all
2
3
4
5
Perfectly