Hi ruby list,
I´m a smalltalk developer and now i’m beginning with Ruby. I found
words like “puts” on the ruby syntax that i don´t understand.
The basic object paradigm formula is “receiver + message”, an emisor
send a message to a receiver.
Is puts a message? if the answer is true, then what is the receiver?
and when is “puts” implemented? if the answer is false, then What is
A smalltalk code similar to ruby code
puts “Hello world”
Transcript show: ‘Hello world’
when “Transcript” is a global variable and the receiver of the message
#show: and ‘Hello world’ is an argument of the message.
other case is the bifurcation example
if self == 0
return self * ((self-1).factorial)
^self = 0 ifTrue: [ 1 ] ifFalse: [ self * ((self-1) factorial) ]
the message #ifTrue:ifFalse: is implemented in the class Boolean and
in his subclasses, and receive two block argmuments, the behavior if
the boolean is true and the behavior if the boolean is false. I don´t
understand like it works in ruby, when is implemented the message “if