Today I have heard that you can use ; in Smalltalk to
refer to the last used object.
I could be wrong, but I think this is not possible
in Ruby.
If that is the case, does someone know the reason
for this, or another way to refer to the last
used object with some kind of “sugar” (like the
; in Smalltalk)?
“It’s easier, I think, to find out yourself than it is to ask the
question :)”
Well, I consider it better to ask silly questions AND get the
reassurance of what I tried, than to assume something on my
own without ever error-checking whether my grounds are solid
or shaken in this regard
“It’s easier, I think, to find out yourself than it is to ask the
question :)”
Well, I consider it better to ask silly questions AND get the
reassurance of what I tried, than to assume something on my
own without ever error-checking whether my grounds are solid
or shaken in this regard
Well, i can reassure you, there is nothing like ; in ruby… and it’s
one of the things where i really envy smalltalk
Transcript show: ‘Hello, World!’; nl!
to compensate this, ruby offers two things… a default receiver of
your messages (self) and simple chaining of methods (without tons of
parenthesis)
print “Hello World”.split.join(", ") << “!\n”
only fooling around of course, something like ; would really be nifty
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.