`There is no equivalent in JavaScript because Javascript does not have
function calls with keyword arguments and even if it , it would still be
not equivalent at least technically.

The message "at:put:" is indeed a keyword that is part of the dictionary of
the object and not just a generic dictionary. So each object has its own
dictionary that associates keywords to method calls. So in Smalltalk you
can not access neither variables (class or instance) nor methods (class or
instance) outside the object, they all are accessed through messages. This
happens to hide the implementation, hence the complexity of the object. The
user does not need to know how the Object works only how to use it.

The only other languages that have such an implementation are ObjC and Ruby
which borrow this directly from Smalltalk.

Also Javascript uses prototype based OOP while Snalltalk is the first
language to implement class based OOP. They are similar but not the same.

On Sun, Oct 16, 2016 at 8:28 AM CodeDmitry <dimamakh...@gmail.com> wrote:

> So "at: x put: y" translates to a method named #at:put:(or "at:put:")?
> |dict|
> dict := Dictionary new.
> dict at: 'foo' put: 'bar'.
> So javascript equivalent would be(assuming the Dictionary object existed).
> var dict;
> dict = new Dictionary;
> dict['at:put:']('foo', 'bar');
> --
> View this message in context:
> http://forum.world.st/How-do-Smalltalk-disambiguate-messages-tp4918946p4918951.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to