Does Ruby have anything that Smalltalk doesn't? The language looks almost one-to-one except with a Pascal/C look and operator precedence.
1 Answers
Things Ruby has and Smalltalk doesn't:
Ruby has mixins; Smalltalk does not.
Ruby permits adding methods to individual objects; in Smalltalk, all methods reside in classes.
Ruby has several other literal syntaxes for convenience, that Smalltalk does not.
In Ruby, it is practical and somewhat useful to add methods dynamically in Smalltalk, the practice is generally to treat the methods and classes as static.
Ruby offers powerful macros in class definitions; Smalltalk offers no macros at all.
- Ruby offers a very convenient syntax for expressing patterns over strings, i. e., regular expressions. It looks just like in the Unix "ed" line editor, with the pattern between slashes. Smalltalk has nothing of the kind, in its syntax.
In Ruby (as in the language Self, the pioneer in this regard, and from which the language Self gets its name), you can usually abbreviate message calls on "self" by omitting the mention of "self". For example, for "self.foo" you can write simply "foo". But in Smalltalk, you cannot abbreviate "self foo" by writing simply "foo". This makes a major economy in writing and reading Ruby code.
Ruby does not require declarations of all local variables and instance variables.

- 20,639
- 6
- 60
- 82
-
4While the above summary is mostly correct, all of the things mentioned above can, have and are commonly done in Smalltalk without requiring a change to the VM or language. For example: [Extending Smalltalk with Mixins](http://www.bracha.org/mwp.html), [Object specific behaviors](http://stackoverflow.com/questions/14196417/is-it-possible-to-extend-an-individual-object-in-smalltalk#14196807), Macros with the [Helvetia](http://scg.unibe.ch/archive/phd/renggli-phd.pdf) system, etc. – Lukas Renggli Dec 26 '15 at 13:40