**Challenge yourself-old**
Ejercicios tomados de el capítulo homónimo del libro [Learning Object-Oriented Programming, Design with TDD in Pharo](https://files.pharo.org/books-pdfs/learning-oop/2018-04-01-LearningOOP.pdf)
# Challenge: Message identification For each of the expressions below, fill in the answers * What is the receiver object? * What is the message selector? * What is/are the argument (s)? * What is the result returned by this expression execution?
* receiver: 3 * selector: + * argument: 4 * result: 7
* receiver: Date * selector: today * result: 2025-04-23
* receiver: #('' 'World') * selector: at : put * argument: 1, Hello * result: "hello" "world"
* receiver: #(1 22 333) * selector: at * arguments: 2 * result: 22
* receiver: # (2 33-4 67) * selector: collect * arguments: [ :each | each abs ] * result: 2 33 4 67
* receiver: 25 * selector: @ * arguments: 50 * result:
![ ](https://i.imgur.com/oMfNkG0.jpeg)
* receiver: SmallInteger * selector: maxVal * result: 1152921504606846975
* receiver: #(a b c d e f) * selector: includesAll * arguments: #(f d b) * result: true
* receiver: true * selector: false * result: true
* receiver: point * selector: selectors * result:
![ ](https://i.imgur.com/H2mN0pH.jpeg)
# Challenge: Literal objects What kind of object does the following literal expressions refer to? It is the same as asking what is the result of sending the class message to such ex pressions.
Tipo de objeto: números
Tipo de objeto: números
Tipo de objeto: números
Tipo de objeto: Cadenas
Tipo de objeto: Cadenas
Tipo de objeto: Caráctares
Tipo de objeto: Caráctares
Tipo de objeto: números
# Challenge: Kind of messages Examine the following messages and report if the message is unary, binary or keyword-based
Tipo de mensaje: unario
Tipo de mensaje: unario
Tipo de mensaje: binario
Tipo de mensaje: unario
Tipo de mensaje: binario
Tipo de mensaje: unario
Tipo de mensaje: binario
# Challenge: Results Examine the following expressions. What is the value returned by the execu tion of the following expressions?
Resultado: -2
Resultado: -2
Resultado: 32
Resultado: Self second
Resultado:
![ ](https://i.imgur.com/8aEF9F5.jpeg)
Resultado: 5
Resultado: -32
Resultado: true
# Challenge: unneeded parentheses Putting more parentheses than necessary is a good way to get started. Such practice however leads to less readable expressions. Rewrite the following expressions using the least number of parentheses.
Ajuste de paréntesis: x between: (pt1 x and: pt2 y)
`Ajuste de paréntesis: #(a b c d e f) asSet intersection: #(f d b) asSet`
Ajuste de paréntesis: (x isZero ifTrue: [....] x includes: y) ifTrue: [....]
Ajuste de paréntesis: OrderedCollection new add: 56; add: 33; yourself
Ajuste de paréntesis: (3 + 4) + (2 * 2) + (2 * 3)
Ajuste de paréntesis: Integer primesUpTo: 64 sum
'http://www.pharo.org' asUrl retrieveContents