Still you don't understand how Ruby syntax works. Every method call every
function you see is basically a masquerade message sent. Those calls are
just syntactic sugar, they don't exist, they are there to make people to
feel more comfortable giving them the illusion that is a call because it
looks like a call, but is all message sents.

So there is no need to do what you doing .

Ruby does not just implement message scents, it's basically Smalltalk
pretending to be something else. So most of Smalltalk syntax is there.

For me it's is the ONLY language that can claim it's Smalltalk language

Messages are very hard to implement if not impossible because they required
that calls don't exist or be disabled, otherwise the existence of message
is pointless. And since no language I am aware of allow you to disable
calls and replace them with messages , what you trying to do is pointless .

Of course to be devil's advocate here Smalltalk in vast majority uses
messages as calls so there existence is kinda pointless too, risking to be
burn in fire by my fellow Smalltalkers , I have only seen the power of
message to be taken advantage of in the case of messageNotUnderstood be
linked to doesNotUnderstand method. In every other case I have encountered
the message always has the same name as the method, which defeats the
purpose of the message in the first place. This is also the default
behavior of the IDE.
On Sun, 16 Oct 2016 at 12:54, CodeDmitry <> wrote:

> I tried so hard to find an example of Ruby using smalltalk message syntax.
> You can do something like:
> class Dictionary
>     attr_accessor :dict
>     def initialize()
>         @dict = {}
>     end
>     def at(*args)
>         if (args.length == 1) then
>             return @dict[args[0]]
>         end
>         @dict[args[0]] = args[1][:put]
>     end
> end
> dict =
> 3, put: 4
> puts dict.dict
> puts 3
> But it's pretty expensive to disambiguate messages to "at" this way.
> The JS approach was much simpler since each message like 'at:put:' or 'at'
> were sent to appropriate receiver functions, whereas this is just a
> spaghetti :\
> I'm sure there's more elegant way of doing this in Ruby but I haven't found
> it :|
> --
> View this message in context:
> Sent from the Pharo Smalltalk Users mailing list archive at

Reply via email to