Forum: Ruby Funny doc for setter

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1c0cd550766a3ee3e4a9c495926e4603?d=identicon&s=25 John Joyce (Guest)
on 2007-05-05 18:57
(Received via mailing list)
Is it just me or is this funny?

------------------------------------------- Object#instance_variable_set
      obj.instance_variable_set(symbol, obj)    => obj
703fbc991fd63e0e1db54dca9ea31b53?d=identicon&s=25 Robert Dober (Guest)
on 2007-05-05 22:50
(Received via mailing list)
On 5/5/07, John Joyce <> wrote:
> Is it just me or is this funny?

I see the same subtle humor here :)

851acbab08553d1f7aa3eecad17f6aa9?d=identicon&s=25 Ken Bloom (Guest)
on 2007-05-09 02:40
(Received via mailing list)
On Sun, 06 May 2007 01:56:18 +0900, John Joyce wrote:

>       this call.
Yeah, but it doesn't expose anything that didn't already exist in Ruby.
If the function didn't exist, you could write it yourself:

class Object
  def instance_variable_set symbol, obj
    eval "@#{symbol}=obj"

8f6f95c4bd64d5f10dfddfdcd03c19d6?d=identicon&s=25 Rick Denatale (rdenatale)
on 2007-05-09 22:43
(Received via mailing list)
On 5/8/07, Ken Bloom <> wrote:
> > provide
> end
Ahh, but it's a subtle reminder that even if something is possible one
shouldn't always do it, at least without thought to the consequences.

Rick DeNatale

My blog on Ruby
This topic is locked and can not be replied to.