Hi, I can''t seem to find an easy way to compare two arrays (or hashes) when using prototype--I had to write a disturbingly long function to do it correctly... Am I missing something? If not, is this something that others would be a welcome addition to the library? Floyd --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 25, 12:55 am, floyd <tfwri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I can''t seem to find an easy way to compare two arrays (or hashes)I''ve often seen people (incorrectly in my opinion) call javascript objects "hashes" because they have name/value pairs, but to call an Array a hash is going a bit far.> when using prototype--I had to write a disturbingly long function to > do it correctly... Am I missing something? If not, is this something > that others would be a welcome addition to the library?What do you mean by "compare" and "correctly"? How can anyone comment on your design without any details or the implementation without the code? Make sure the code is nicely formatted and commented, then post it. You may get helpful hints - or not. -- Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hashes and arrays both provide the inspect() function if you''re using prototype. In which case something like: myHash1.inspect() == myHash2.inspect() would probably do what you need. On 4/24/07, RobG <rgqld-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> > > > On Apr 25, 12:55 am, floyd <tfwri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > > I can''t seem to find an easy way to compare two arrays (or hashes) > > I''ve often seen people (incorrectly in my opinion) call javascript > objects "hashes" because they have name/value pairs, but to call an > Array a hash is going a bit far. > > > when using prototype--I had to write a disturbingly long function to > > do it correctly... Am I missing something? If not, is this something > > that others would be a welcome addition to the library? > > What do you mean by "compare" and "correctly"? How can anyone comment > on your design without any details or the implementation without the > code? Make sure the code is nicely formatted and commented, then post > it. You may get helpful hints - or not. > > -- > Rob > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---