Hi,

Does that mean lets say on a deployed app, the Rails server/stack
starting initiates new object_id's being assigned, are the object_id's
still unique for each object over time (with server restarts etc.) if
they are based on a time algorithm ?

Thanks for your help and clarification on this.

Rajive

On Aug 13, 12:42 pm, Rick DeNatale <[email protected]> wrote:
> On Wed, Aug 12, 2009 at 10:25 PM, Ruby on
>
> Rails<[email protected]> wrote:
>
> > Thanks Fred ,
>
> >  I am not getting that concept of ruby . We have nil.object_id is 4
> > ,are they fix for every value, i am not sure for this .
>
> No, not in general, and the real story is rather dependent on the
> particular Ruby implementation.
>
> If we are talking the MRI (or Matz' Ruby Implementation) then there
> are a few objects like nil, true, false... with fixed object_ids, also
> FixedNum instances have an object_id which can be computed from their
> value.
>
> In general though the object_id is typically related to the address of
> the object in memory, so you can't rely on any fixed mapping based on
> value, in fact, the object_id which is the identity of the object has
> to be independent of the state for a mutable object.
>
> --
> Rick DeNatale
>
> Blog:http://talklikeaduck.denhaven2.com/
> Twitter:http://twitter.com/RickDeNatale
> WWR:http://www.workingwithrails.com/person/9021-rick-denatale
> LinkedIn:http://www.linkedin.com/in/rickdenatale
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to