From: Justin Collins Date: 2008-04-23T11:56:12+09:00 Subject: Re: Ruby and object paradigm Andres wrote: > 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 > "puts"? > > > "puts" is a message and is implemented in the Kernel module: http://ruby-doc.org/core/classes/Kernel.html#M005995 The implicit receiver is "self", which at the top level is an object called "main". > 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 > else"? > > Thanks > Andr�s > > > In Ruby, "if" and family are keywords, not messages. I suspect this is because Ruby doesn't have the ability to do "keyworded" methods, making something like "if...elseif...else..." difficult. -Justin